浏览网站时,Jquery 在 IE7 中切换闪烁

发布于 2024-11-29 18:32:03 字数 583 浏览 3 评论 0原文

我用 jquery 创建了一个切换,但每次我在 IE 7 中浏览网站时它都会闪烁???

  jQuery.noConflict(); // start substituting $ for jQuery
jQuery(document).ready(function( ) {
jQuery('#loginToggle').hide();
 jQuery('#login img').toggle(
        function() {

       jQuery('#loginToggle').slideToggle(200);
         jQuery('#info').animate({ left:"-=235px", width: "420px"},"fast");

        },
        function() {
          jQuery('#loginToggle').slideToggle(200);
         jQuery('#info').animate({ left:"+=235px",  width: "420px"},"fast");
      }
    ); // end toggle
});

谢谢

I created a toggle with jquery but it is flickering every time i navigate the website in IE 7???

  jQuery.noConflict(); // start substituting $ for jQuery
jQuery(document).ready(function( ) {
jQuery('#loginToggle').hide();
 jQuery('#login img').toggle(
        function() {

       jQuery('#loginToggle').slideToggle(200);
         jQuery('#info').animate({ left:"-=235px", width: "420px"},"fast");

        },
        function() {
          jQuery('#loginToggle').slideToggle(200);
         jQuery('#info').animate({ left:"+=235px",  width: "420px"},"fast");
      }
    ); // end toggle
});

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

殊姿 2024-12-06 18:32:03

当像您一样使用参数化列表进行动画时 { left:"+=235px ..."} 我发现它有助于放置 position: wpx xpx ypx zpx; 在您尝试设置动画的元素上。

这样,jquery 可以修改的元素上实际上已经有了一个 css 样式...我认为 IE 确实有这个问题。

When doing animation with the parameterized list like your doing { left:"+=235px ..."} I found that it helps to put a position: wpx xpx ypx zpx; on the element that you're trying to animate.

That way there is actually a css style already on the element that jquery can modify... I think IE did have a problem with that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文