jquery笔记2012-9-29

页面加载完成后滚屏到指定位置,如下代码

$(document).ready(function(){
    $("html,body").animate({scrollTop:$("#content_swf").offset().top},2000);
});

说明:$(“html”) 在IE,firefox才生效 $(“body”) 在chrome,safari 才生效

Comments are closed.