jquery链式操作的正确使用方法

内容摘要
糟糕的使用方法复制代码 代码如下:$second.html(value);$second.on('click',function(){alert('hello everybody');});$second.fadeIn('slow');$second.animate({height:'12
文章正文

糟糕的使用方法

复制代码 代码如下:

$second.html(value);
$second.on('click',function(){
alert('hello everybody');
});
$second.fadeIn('slow');
$second.animate({height:'120px'},500);

建议使用方法

复制代码 代码如下:

$second.html(value);
$second.on('click',function(){
alert('hello everybody');
}).fadeIn('slow').animate({height:'120px'},500);


代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!