大佬教程收集整理的这篇文章主要介绍了jquery的javascript是否有办法调用不等于变量?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_197_7@$('#SiteDescriptions' + i).animate({opacity: "1"},500); $('#SiteDescriptions' + !i).animate({opacity: "0"},500);
@H_197_7@$SD = $('.SiteDescription'); // cache jquery object $SD.on('click',function(){ // fade out all with this class $SD.stop().animate({opacity:0},500); // fade in new active element $(this).stop().animate({opacity:1},500); });
如果您尝试选择除该ID之外的任何内容,您将选择页面上不是它的每个元素.而且我认为这不是你想要的.
不要这样做,按类的方式做,但这更接近你的要求:
@H_197_7@$('#SiteDescriptions'+i).animate({opacity : 1 },500) // I don't want to speculate on your dom structure,but if you are using id's // you still need a way to prevent from fading out everything on the page that // isn't the new action. So I am assuming that all the #SiteDescriptions are siblings .siblings().not('#SiteDescriptions'+i).animate({opacity: 0},500);
以上是大佬教程为你收集整理的jquery的javascript是否有办法调用不等于变量?全部内容,希望文章能够帮你解决jquery的javascript是否有办法调用不等于变量?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。