第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

jQuery從不同頁面滾動到ID

jQuery從不同頁面滾動到ID

森林海 2019-09-21 11:21:03
我試圖在某些頁面中使用jQuery的頁面滾動,并且可以成功地進(jìn)行平滑的頁面滾動。我現(xiàn)在唯一的問題是嘗試從其他頁面執(zhí)行此操作。我的意思是,如果我單擊頁面中的鏈接,它將加載新頁面,然后滾動到特定的div元素。這是我用來在頁面內(nèi)滾動的代碼:var jump=function(e){       //prevent the "normal" behaviour which would be a "hard" jump       e.preventDefault();   //Get the target   var target = $(this).attr("href");   //perform animated scrolling   $('html,body').animate(   {           //get top-position of target-element and set it as scroll target           scrollTop: $(target).offset().top   //scrolldelay: 2 seconds   },2000,function()   {           //attach the hash (#jumptarget) to the pageurl           location.hash = target;   });}$(document).ready(function(){       $('a[href*=#]').bind("click", jump);       return false;});我希望這個主意很清楚。謝謝非常重要的注意:我上面發(fā)布的這段代碼在同一頁面內(nèi)也很好用,但是我要單擊的是單擊一個頁面上的鏈接,然后轉(zhuǎn)到另一頁面,然后滾動到目標(biāo)。我希望現(xiàn)在已經(jīng)清楚了。謝謝
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 440 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號