首页 > 语言 > JavaScript > 正文

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

2024-05-06 14:31:07
字体:
来源:转载
供稿:网友

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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选