当前位置:Gxlcms > JavaScript > jquery链式操作的正确使用方法

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

时间:2021-07-01 10:21:17 帮助过:6人阅读

糟糕的使用方法
代码如下:
$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);

人气教程排行