仅使用列表的IE8中的jQuery slideToggle问题 [英] Jquery slideToggle problem in IE8 only using lists

查看:110
本文介绍了仅使用列表的IE8中的jQuery slideToggle问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Jquery还是很陌生,并且第一次尝试使用slideToggle创建一些下拉列表.它们中的一些相互叠放,当单击一个时,所有其他都应折叠.我确信我的代码不是很理想,因为我才刚刚起步,但是除了IE8之外,其他一切都工作正常.在IE8中,关闭两个下拉菜单之间的空间会折叠,所有内容都会变得一团糟.您可以使用页面左侧的菜单在demo.djcase.com上看到问题.

I am quite new to Jquery and for the first time tried to use slideToggle to create some dropdowns. A few of them are stacked on top of each other and when one is clicked, all others should collapse. I am sure my code isn't ideal since i'm just starting out, but everything works fine except in IE8. In IE8, the space between the dropdowns collapse when closing one, and everything gets kind of messed up. You can see the problem at demo.djcase.com using the menus on the left side of the page.

所有jquery代码都位于 http://demo .djcase.com/sites/all/themes/djcase/script.js

All of the jquery code is located at http://demo.djcase.com/sites/all/themes/djcase/script.js

任何帮助将不胜感激.谢谢. 布莱恩

Any help would be appreciated. Thanks. Brian

推荐答案

我想现在已经解决了.我正在使用以下HTML

I think i have it fixed now. I was using the following HTML

<div class="services_menu" ><p>Services</p></div>
<ul class="services-menu">
  <li><a href="/services/communications-marketing-and-public-relations">Communications, Marketing and Public Relations</a></li>
  <li><a href="/services/web-development">Web Development</a></li>
  <li><a href="/services/interpretation-and-conservation-education">Interpretation and Conservation Education</a></li>
  <li><a href="/services/human-dimensions-market-research-and-evaluation">Human Dimensions, Market Research and Evaluation</a></li>
  <li><a href="/services/facilitation-strategic-planning-and-public-involvement">Facilitation, Strategic Planning and Public Involvement</a></li>
  <li><a href="/services/graphic-design">Graphic Design</a></li>
  <li><a href="/services/video-and-multimedia-production">Video and Multimedia Production</a></li>
  <li><a href="/services/event-planning-and-management">Event Planning and Management</a></li>
  <li><a href="/services/training">Training</a></li>
</ul>

我在结束的Div和列表的开头之间添加了以下内容

I added the following between the closing Div and the start of the list

<p class="fixInIe">&nbsp;</p>

我将此样式设置为0的行高,这样我就不会得到多余的空间.我不知道为什么需要这样做,但是它起作用了.

I styled this to have a line height of 0 so i wouldn't get the extra space. I don't know why this was needed, but it worked.

这篇关于仅使用列表的IE8中的jQuery slideToggle问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆