加载时,网站可以在确定的div中启动?
问题描述:
加载时,网站可以在确定的div中启动? 我制作了this这样的三个div。
我想在网站加载时启动第二个div。 我该怎么做?加载时,网站可以在确定的div中启动?
html,body {
height:100%;
margin:0;
}
.content {
height:100%;
min-height:100%;
}
html>body .content {
height:auto;
}
#one {
background: #ff4444;
}
#two {
background: #ff5555;
}
#three {
background: #ff6666;
}
<div class='content' id='one'></div>
<div class='content' id='two'></div>
<div class='content' id='three'></div>
答
使用此滚动第二个div眼帘负载:
$(function() {
$("#two")[0].scrollIntoView();
});
1)您可以更改divs的顺序。 2.)你可以使用js/jQuery使用'scrollTop'来显示div。等 – Jai
当网站加载我想看到第二个div,那么它可以向下滚动或顶部看到其他人 – jorgebmx