简体   繁体   English

IE8 .next()或最近的()无效

[英]IE8 .next() or closest() dosen't work

I try to debug a IE8 bug and I'm pretty stuck with it 我尝试调试IE8错误,但我对此非常棘手

$('.help-link').live('click', function (evt) {
var content = $(this).next('.help-content');
   if (!content.is(':visible')) {
       content.fadeIn(200);
   $(this).addClass('on');
    } else {
   content.fadeOut(150);
   $(this).removeClass('on');
   }
});

If you click on the link a div right under the link should fade in and fade out on the second click actually very simple. 如果单击链接,则在链接下方的div应该淡入淡出,而第二次单击时淡出则非常简单。 Works for all browsers just fine all but IE8. 适用于所有浏览器,但IE8除外。 I also didn't find any solution to debug the script. 我也没有找到任何调试脚本的解决方案。 The dev tool bar of the IE ignores my "console.log()"s. IE的开发工具栏会忽略我的“ console.log()”。 Thank you very much for your help! 非常感谢您的帮助!

You're missing a ); 您缺少); at the end, not sure if it matters: 最后,不确定是否重要:

http://jsfiddle.net/BPCUL/ http://jsfiddle.net/BPCUL/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM