js將滾動(dòng)條滾動(dòng)到指定位置的簡單實(shí)現(xiàn)方法
來源:易賢網(wǎng) 閱讀:2339 次 日期:2016-07-12 15:32:38
溫馨提示:易賢網(wǎng)小編為您整理了“js將滾動(dòng)條滾動(dòng)到指定位置的簡單實(shí)現(xiàn)方法”,方便廣大網(wǎng)友查閱!

下面小編就為大家?guī)硪黄猨s將滾動(dòng)條滾動(dòng)到指定位置的簡單實(shí)現(xiàn)方法。小編覺得挺不錯(cuò)的, 現(xiàn)在就分享給大家,也給大家做個(gè)參考。

代碼如下(主要是通過設(shè)置Location的hash屬性):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>無標(biāo)題文檔</title>

<script type="text/javascript">

function aa(){

  window.location.hash = "#title";  

}

</script>

</head>

<body onload="aa()">

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

<span id="title" class="title" >天一廣場</span><br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

頁面內(nèi)容<br />

</body>

</html>

以上就是小編為大家?guī)淼膉s將滾動(dòng)條滾動(dòng)到指定位置的簡單實(shí)現(xiàn)方法全部內(nèi)容了

更多信息請查看網(wǎng)絡(luò)編程
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn)

版權(quán)所有:易賢網(wǎng)