首页 > 其他 > 详细

jq toggle() 状态切换

时间:2017-04-19 10:16:43      阅读:205      评论:0      收藏:0      [点我收藏+]
                // $(‘.cjwt_list .qbox‘).on(‘click‘,function(){
		// 	if($(this).next(‘.abox‘).is(‘:visible‘)){
		// 		$(this).removeClass(‘on‘);
		// 		$(this).next(‘.abox‘).stop(true,true).slideUp();
		// 	}else{
		// 		$(this).addClass(‘on‘);
		// 		$(this).next(‘.abox‘).stop(true,true).slideDown();
		// 	}
		// })



		$(‘.cjwt_list .qbox‘).on(‘click‘,function(){
			$(this).next(‘.abox‘).stop(true,true).slideToggle();
			$(this).toggleClass(‘on‘);
		})                    

  上下两段代码效果一样!!!

jq toggle() 状态切换

原文:http://www.cnblogs.com/ghfjj/p/6731316.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!