如何使用JavaScript平滑滾動?我想平滑向下滾動DIV誰能知道如何在JavaScript代碼中添加平滑滾動下面html javascript smooth scroll
function scroll_to(val) {
if(val== "Scroll down to div id")
document.getElementById('divid11').scrollIntoView();
}
<select onchange="scroll_to(this.value);">
<option>1111111</option>
<option>2222222</option>
<option >Scroll down to div id</option>
<option>4444444</option>
<option>5555555</option>
<option>6666666</option>
</select>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div id='divid11'>scroll</div>
這裏的「滾動」在哪裏? – divy3993
[JQuery平滑滾動時單擊錨鏈接]可能的重複(http://stackoverflow.com/questions/7717527/jquery-smooth-scrolling-when-clicking-an-anchor-link) – allicarn
@allicarn它只被標記,但它不使用jQuery! – Anonymous0day