html dom 设置滚动条卷动位置

1.做用对象

有 #outer>#inner
#inner有实际的宽度
则在#outer有机会产生滚动条
因此设置.scrollleft应该做用到#outer上.dom

2.参数单位为空

$('#outer').scrollLeft="100";
不用带px;
顺便附带
random():
Math.random(); //得到0~1之间的随机数,不一样的平台,可能小数点位数不同
floor:
Math.floor(x);//能够取得最大不大于本数的数
获得可用随机数
Math.floor(100*Math.random())
设置粘度与滞性.在求百分比以后能够使用Math.sqrt,或Math.pow求幂.code

相关文章
相关标签/搜索