码迷,mamicode.com
首页 > 其他好文 > 详细

jq toggle() 状态切换

时间:2017-04-19 10:15:29      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:效果   blog   javascrip   remove   pre   ble   list   on()   ext   

                // $(‘.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() 状态切换

标签:效果   blog   javascrip   remove   pre   ble   list   on()   ext   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!