开发者

Why won't jQuery accordion section activate in IE 8?

I am using a multi-part form within the jQuery UI accordion. When a user clicks on "next," the next section that has not already been submitted opens. It is not working properly in IE 8 - the next section does not open. Anyone have any thoughts on what I can do here to ensure compatibility with IE 8?

EDITED UDPATE TO QUESTION: Using IE Developer Tools, I found that the code is breaking at "next=i." The error states "Object doesn't support this property or method." Any thoughts as to what I'm doing wrong here?

$(":submit").live('click', function() {
whichButton =  $(this).val();
})

$("#selection-form").validate({
   submitHandler: function(form) {
     var acc = $("#accordion");
//...
   complete: function(e) {
     $('#selection-information').attr('state', 1);
     acc.children('.step').each(function(i){
         if($(this).attr('state') == 0) 
            {
        next = i;
        return false;
        }
    })
        if(whichButton=='complete'){
         acc.accordion('activate',next);            
}

//...

UPDATE: The problem seems to be with trying to activate with "next," rather than with a specific index number (even though "next" is supposed to identify the index to open). If 开发者_Python百科I replace "next" with an actual index number, that section opens. Any thoughts on how to fix this specific problem?


I ran into this same problem. IE is very finicky about proper html and making sure that inside your accordion, there is nothing outside the <h3></h3><div></div> structure, for example, it you have this:

<h3>a header</h3>
<div>some content</div>
<h3>another header</h3>
<div>some more content</div>

it will work, but this will not:

<h3>a header</h3>
<div>some content</div>
<span>extra stuff</span>
<h3>another header</h3>
<div>some more content</div>

This would all be inside whatever element you call .accordion() on.


Apparently, there was a conflict or problem with the use of the name "next." I changed "next" to "nxt" within the function and the accordion is now working in IE8.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜