js让页面加载后向下滑动一段距离

JavaScript014

js让页面加载后向下滑动一段距离,第1张

页面加载完成事件JQuery是$(function() { 这是页面加载完成后会执行的代码})页面下滑代码$('html,body').animate({scrollTop:100px},500)100px为从顶部开始向下滑的距离 500为下滑时间 单位为毫秒 可以控制下滑速度时间越短下滑速度越快 两者结合 即可实现你说的页面加载后向下滑动一定距离

html页面里写:

<body id="home" ontouchstart="touchStart()" ontouchmove="touchMove()" ontouchend="touchEnd()">

js里边写:

function touchStart(){

event

}

function touchMove(){

event

}

function touchEnd(){

event

}