-1
有人可以帮助,我目前使用JavaScript来显示一个隐藏的div,当一个复选框被选中,我也希望它在div显示为自动后自动滚动页面div的焦点,目前它没有做任何事情,我希望它向下滚动一定的百分比,如5%或什么东西把div集中在页面上,有人可以告诉我如何做到这一点?在检查上的JavaScript滚动到页面底部
的javascript:
<script>
function showMore(more) {
document.getElementById("content3").style.display = more.checked ? "block" : "none";
document.body.scrollBottom = document.documentElement.scrollBottom = 10%;
}
</script>
HTML:
<input type="checkbox" id="tick2" class="tick2" name="tick2" value="0" onClick="showMore(this);" />
我很确定你不想在第三行有两个'='符号。 –
check [here](http://stackoverflow.com/questions/11715646/scroll-automatically-to-the-bottom-of-the-page) –
[自动滚动到页面底部](http ://stackoverflow.com/questions/11715646/scroll-automatically-to-the-bottom-of-the-page) –