Jquery $(this) 表示什么ul,li{margin:0;padding:0}#scrollDiv{width:300px;height:50px;line-height:25px;border:#ccc 1px solid;overflow:hidden}#scrollDiv li{height:50px;padding-left:10px;}function AutoScroll(obj){$(obj).find("ul:first").animate({margi
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/04 13:53:42
![Jquery $(this) 表示什么ul,li{margin:0;padding:0}#scrollDiv{width:300px;height:50px;line-height:25px;border:#ccc 1px solid;overflow:hidden}#scrollDiv li{height:50px;padding-left:10px;}function AutoScroll(obj){$(obj).find(](/uploads/image/z/1732792-40-2.jpg?t=Jquery+%24%28this%29+%E8%A1%A8%E7%A4%BA%E4%BB%80%E4%B9%88ul%2Cli%7Bmargin%3A0%3Bpadding%3A0%7D%23scrollDiv%7Bwidth%3A300px%3Bheight%3A50px%3Bline-height%3A25px%3Bborder%3A%23ccc+1px+solid%3Boverflow%3Ahidden%7D%23scrollDiv+li%7Bheight%3A50px%3Bpadding-left%3A10px%3B%7Dfunction+AutoScroll%28obj%29%7B%24%28obj%29.find%28%22ul%3Afirst%22%29.animate%28%7Bmargi)
Jquery $(this) 表示什么ul,li{margin:0;padding:0}#scrollDiv{width:300px;height:50px;line-height:25px;border:#ccc 1px solid;overflow:hidden}#scrollDiv li{height:50px;padding-left:10px;}function AutoScroll(obj){$(obj).find("ul:first").animate({margi
Jquery $(this) 表示什么
ul,li{margin:0;padding:0}
#scrollDiv{width:300px;height:50px;line-height:25px;border:#ccc 1px solid;overflow:hidden}
#scrollDiv li{height:50px;padding-left:10px;}
function AutoScroll(obj){
$(obj).find("ul:first").animate({
marginTop:"-50px"
},500,function(){
$(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
});
}
$(document).ready(function(){
setInterval('AutoScroll("#scrollDiv")',1000)
});
这是公告标题的第一行
dfgsdfgsdfgsdfgs
这是公告标题的第二行
dfgsdfgsdfgsdfgs
这是公告标题的第三行
dfgsdfgsdfgsdfgs
这是公告标题的第四行
dfgsdfgsdfgsdfgs
这是公告标题的第五行
这是公告标题的第六行
这是公告标题的第七行
这是公告标题的第八行
Jquery $(this) 表示什么ul,li{margin:0;padding:0}#scrollDiv{width:300px;height:50px;line-height:25px;border:#ccc 1px solid;overflow:hidden}#scrollDiv li{height:50px;padding-left:10px;}function AutoScroll(obj){$(obj).find("ul:first").animate({margi
$(obj).find("ul:first").animate({
marginTop:"-50px"
},500,function(){
$(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
});
其中this代表 查找的目标ul 对象 ,但这是javascript对象,它是不能直接使用jQuery API的必须转换为jQuery 对象 即 $(this)如此包装 ,即可使用 如 jQuery.css 方法