jQuery slideToggle:在IE 8中向上滑动后会出现打ic [英] jQuery slideToggle: Hiccups after sliding up in IE 8

查看:61
本文介绍了jQuery slideToggle:在IE 8中向上滑动后会出现打ic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery slideToggle()函数显示和隐藏范围.这是我的代码:

I am using the jQuery slideToggle() function to show and hide a span. Here is my code:

$(".slideButton")
  .click(function(event) {
    $(".slideText").slideToggle("slow");
    event.preventDefault();
  });

<span class="slideText" style="display:none">
   blah...blah...blah
</span>
<a href="" class="slideButton">more...</a>

它的工作方式与打开时的预期相同,但是在关闭时,跨度会滑动关闭,然后快速闪烁跨度中的所有文本,最后消失.几乎像打has一样.

It works the way I would expect on opening, but when closing, the span slides closed, then quickly flashes all the text in the span, and finally disappears. Almost like it has a hiccup.

我在IE 8中遇到此问题,但在Firefox中没有.

I have this issue in IE 8, but not Firefox.

有人知道要解决此问题吗?谢谢.

Anyone know to resolve this? Thanks.

推荐答案

好的,这似乎与body标记中定义的CSS行高有关.当我清除line-height属性时,似乎可以解决该问题.

OK, it appears to have something to do with the CSS line-height that is defined in the body tag. When I clear the line-height property it appears to fix the issue.

但是,由于遇到了很多麻烦,因此我采取了另一种方法,现在使用的是

However, since I was running into so much trouble with this, I took another approach and I am now using the jQuery Expander Plugin.

更新08/06/10::我删除了JQuery Expander插件.我使用它来折叠/扩展大表中的文本.如果表超过了这么多行,性能将下降到无法接受的水平.并不是说这不是一个很好的插件,但是它不能满足我的需求.

Update 08/06/10: I dropped the JQuery Expander Plugin. I was using it to collapse/expand text in a large table. If the table exceeded so many rows, the performance degraded to an unacceptable level. That's not to say that this isn't a good plugin, but it wasn't good for my needs.

这篇关于jQuery slideToggle:在IE 8中向上滑动后会出现打ic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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