您的位置:首页 > 其它

点击按钮-滚动条处于页面或者(div)的底部

2015-11-05 22:05 330 查看
<!DOCTYPE html>

<html>

<head>

<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">

</script>

<script>

$(document).ready(function(){

$("button").click(function(){

$("div").scrollTop($("div")[0].scrollHeight);

// alert($("div").scrollTop()+" px");

});

});

</script>

</head>

<body>

<div style="border:1px solid black;width:100px;height:150px;overflow:auto">

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</div><br>

<button>Return the vertical position of the scrollbar</button>

<p>Move the scrollbar down and click the button again.</p>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: