jq toggle() 状态切换

                // $('.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');
		})                    

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

posted @ 2017-04-19 00:32  ghfjj  阅读(1204)  评论(0)    收藏  举报