Problems solved by different jquery versions _javascript skills

Source: Internet
Author: User

This is the most perfect work in the last three months, with JS to achieve a drag-and-drop sort, the effect chart is as follows:

At the beginning of the project with such a drag implementation idea, a little clue not, please teacher brother said this implementation is impossible. At that time feel very sorry, intend to use the traditional way to achieve. The traditional way of thinking, feeling the time is ample, and then back to the idea of dragging. It finally came true. In fact, I do not show off this (of course, interested, you can QQ907087894 contact me, I will organize demo upload to the Resource center), I want to say is below.
In my realization at the same time, sister to help another partner wrote a traditional program of the demo, he is the modification of the sort. On her machine demo, at that time feel very shocked, in her mouse sliding, a short tour of the code, looking at the long chain of JS, Dayton students admiration. At that time thought, and so on Project knot, study her this well.

2 months later, and so on, leisure. Due to JS unfamiliar, very hard to understand the code, running, flying a bug. When you move, you are always prompted for no selection.

Copy Code code as follows:

for (var j = 0; J < Div_count; J + +) {
if (($ ("#eva_div_all"). Children (). EQ (j). Children (). Children (), EQ (0). attr (' checked ')) = = ' checked ') {
var valid_checked = $ ("#eva_div_all"). Children (). EQ (j). Children (). Children (). EQ (0). attr (' id ');
if (valid_checked==checked_name) {alert (alert_des); return;}
/* Swap * *
var temp = $ ("#eva_div_all"). Children (). EQ (j). attr (' id ');
var temp_html = $ ("#" +temp). html ();
var before_temp = $ ("#eva_div_all"). Children (). EQ (j+num). attr (' id ');
var before_temp_html = $ ("#" +before_temp). html ();
$ ("#" +temp). html (');
$ ("#" +before_temp). html (');
$ ("#" +temp). HTML (before_temp_html);
$ ("#" +before_temp). HTML (temp_html);
Checked = ' true ';
New_order ();
}
}
if (checked== ' false ') {
Alert (' No selection!! ');
}

As if the flying insects into the eyes, constantly rubbing ah rub, is not out, one day is so.
Helpless, to solve the bell still need to fasten the person, she came, debugging for a long time, is not no, and then compared her local code, no difference, she also run normal local. Then we reached a consensus on the browser problem.
Copy Code code as follows:

$ ("#eva_div_all"). Children (). EQ (j). Children (). Children (), EQ (0). attr (' checked ')) = = ' checked ')

Browsers have different support for ehecked properties.

She's Firefox 23, and mine is 16.0.1. Very happy, finally found the crux of the problem, this matter is an end.

One weeks from now, using the same browser to access resources on the server, this problem does not exist. Go on.
Fortunately, do not know where the inspiration, the original introduction of Jquery.js replaced Jquery-1.7.2.min.js, the problem was finally resolved again.
Do not know if it will be overthrown, hehe ~ ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.