首页 > 语言 > JavaScript > 正文

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

2024-05-06 15:59:25
字体:
来源:转载
供稿:网友
jQuery实现方法的链式操作是非常容易的。这里给出正确的使用方法

糟糕的使用方法

复制代码 代码如下:


$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);

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

图片精选