jQuery .slideUp() not working in Chrome

橙三吉。 提交于 2019-12-11 04:29:45

问题


I'm trying to make an accordion like section to a page I'm working on. I'm not using jQueries native accordion plugin because I need the ability to close all the sections. My problem is Chrome doesn't seem to be responding to .slideUp() while everything seems to work perfectly in Firefox and IE. Rather than try and copy all the relative code snippets I just uploaded here http://ianburris.com/p/tmp/. Any ideas what might be causing this in Chrome?


回答1:


You should use a <div> for your containers rather than a <span> here, here's your code (forget the styling, focus on the sliding) as it is, not working with a <span> in chrome.

Here's the working version, the only change is making the element's blocks, <div> elements in this case.

These:

<span id="in-the-classroom" class="menu-pane"> 
//and
<span id="outside-the-classroom" class="menu-pane"> 

Should be:

<div id="in-the-classroom" class="menu-pane"> 
//and
<div id="outside-the-classroom" class="menu-pane">

And of course the matching </span> to </div> changes.




回答2:


Try changing this:

 if (cfe.active_menu_pane !== null) 

to

 if (cfe.active_menu_pane != null) // Remove the second equal sign

Not sure it would matter but it was the one irregularity I saw in a function.



来源:https://stackoverflow.com/questions/3835658/jquery-slideup-not-working-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!