开发者

Jquery Accordion not displaying properly in Chrome

开发者 https://www.devze.com 2023-03-01 07:43 出处:网络
I am using this jQuery script http://www.marghoobsuleman.com/jQuery-common-accordion and have implemented it into my site.

I am using this jQuery script http://www.marghoobsuleman.com/jQuery-common-accordion and have implemented it into my site.

It works fine in Firefox and IE but Chrome doesn't display it correctly. The the entire content div to flickers during the transition and afterwards the content div comes underneath the title divs.

I have narrowed it down to this piece of jQuery code not working correctly:

function openMe(id) {
        var sTitleID = id;
        var iCurrent = sTitleID.split("_")[sTitleID.split("_").length-1];
        options.currentcounter = iCurrent;
        var sContentID = id+"_msContent_"+iCurrent;
        if($("#"+sContentID).css("display")=="none") {
            if(options.previousDiv!="") {
                closeMe(options.previousDiv);
            };
            if(options.vertical) {
                $("#"+sContentID).slideDown("medium");
            } else {
                $("#"+sContentID).show(400);
                //$("#"+sContentID).css({ display: "inline" });
            }
            options.currentDiv = sContentID;
            options.previousDiv = options.currentDiv;
        };
    };
    function closeMe(div) {
        if(options.vertical) {
            $("#"+div).slideUp("medium");
        } else {
            $("#"+div).hide(400);
            //$("#"+div).css({ display: "none" });
        };
    };

When I replace $("#"+sContentID).show(400); with the in comment tags code $("#"+sContentID).show(400); then the animation disaapears but it does display it correctly in all 3 browsers.

Any开发者_如何学编程body have any suggestions as to why Chrome doesn't display it correctly and how I can fix it?

0

精彩评论

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