亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

iframe + hash實現前進后退的問題

iframe + hash實現前進后退的問題

函數式編程 2018-10-25 21:15:33
export function init(){        $('.c-nav-wrapper').on('click','li',function(){         $('.c-footer').hide();         var target = $(this).attr('data-url'); //data-url = "/地址"         if(target){              location.href = '/#' + $(this).data('url');         };     });    window.onhashchange = function(){        var hash = location.hash;        hash = hash.substring(1,hash.length);        $('#ifm').attr('src', hash + '.html');        console.log(history);    }}我這樣寫為什么還會出現點擊兩次后退才能回退的問題?請問我哪里錯了?謝謝各位
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 813 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號