[JQuery 1.3.2] IE8 in the & amp; lt; table & amp; gt; & amp; lt; tr & amp; gt; using Toggle () could not be effective in solution

These days I have received of Art staff do a Q & A static page, because there are a number of questions and answers, so I'm going to explain the hidden part first, let's look at User unfold explain their own content, so he used to jQuery 1.3.2 deal with...


These days I have received of Art staff do a Q & A static page, because there are a number of questions and answers, so I'm going to explain the hidden part first, let's look at User unfold explain their own content, so he used to jQuery 1.3.2 deal with.

Q & A content is


Typesetting, as follows:
Q1: Question 1
A1: 1 Commentary
Q2: Question 2
A2: Commentary 2
Q3: Question 3
A3: Commentary 3

jQuery program:


$('td.Q').click(function() {
    $(this).parent().next().toggle();
});

In the above procedure will result in the implementation of IE8 no longer hidden after the show, if you can run properly in IE8's "compatibility mode", so the program is not wrong.


Developer Tools to view the display properties, none are hidden, perform toggle (after) still is none, will not change:

Developer Tools used in IE View Display Properties check


After compatibility mode to execute, click on "Question 1" can see "Commentary 1" display attributes have been changed to block, and can be run properly:

Switching to a normal display state after use Compatibility Mode IE
This problem was later found to jQuery 1.3.2 the bug, solutions are found here, after so modify the program as follows:


$('td.Q').click(function() {
    var tr = $(this).parent().next();
    tr.toggle(tr.css('display') == 'none');
});


The bug in jQuery 1.3.0 and 1.3.1 does not exist only in 1.3.2, but only with IE8 (non-compatibility mode) will exhibit this problem.


Reference Links:

  • jQuery 1.3.2 causes problems at IE 8
  • $().toggle() does not work with in IE 8 

 

Original: Large column  [jQuery 1.3.2] IE8 in the & lt; table & gt; & lt; tr & gt; solution using Toggle () could not be effective in


Guess you like

Origin www.cnblogs.com/chinatrump/p/11512820.html