开发者

jquery ui accordion ajax troubles

I've got this accordi开发者_如何学JAVAon, which i have sections of that load there content ajaxly on the first opening. It works great in ff, ie 8, and pretty much every browser. but in IE 9, if i click the arrow/triangle it doesn't.

i rigged that up like so:

$("#accordian").accordion({
        collapsible: true,
        autoHeight: false,
        active : false,
        changestart: function (event, ui) {
            var clicked = $(this).find('.ui-state-focus').attr('id');
            if (clicked != "") {
                var alreadyLoaded = $('#' + clicked).attr('alreadyLoaded');
                if (alreadyLoaded == "false") {
                    var divToLoad = $('#' + clicked).attr('divToLoad');
                    var url = $('#' + clicked).attr('urlToLoadMe');

                    $('#' + divToLoad).load(url, function () {
                        //do some post load stuff
                    });
                    $('#' + clicked).attr('alreadyLoaded', "true");
                }
            }

        }

    });

my accordion looks something like this:

 <div id="accordian" style="height:400;">

            <h1 style="padding-left:25px;padding-top:5px; padding-bottom:5px;font-weight:bold;" id="ContactInformationHeader" urlToLoadMe="a url is here" alreadyLoaded="false" divToLoad="ContactInformationSearchSectionDiv">Contact Information</h1>
            <div id="ContactInformationSearchSectionDiv">
                loading
            </div>
    </div>

obviously with some more sections... but that's not important.

it works in firefox(3.X and 4), ie 8, but not 9. if i click anywhere but the little triangle it works!

it seems like the wrong thing is getting the ui-state-active or something. anyone had a similar problem? ideas? help?

jquery version 1.4.1 jquery ui version 1.8.11

EDIT: i've narrowed it down to this: in ie 9, it seems to be that changestart is firing before .ui-state-focus is being assigned to everything, b/c it is null. as is the ui-state-active.


I fixed it by changing changestart to change, so it fires later. This means there is a slight delay in the ajax loading, but that is more acceptable then the arrow click not getting it at all!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜