如何?html後台導航iframe點擊換url(代碼)

來源:互聯網
上載者:User

本篇文章給大家帶來的內容是關於如何?html後台導航iframe點擊換url(代碼) ,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所協助。

寫了個小項目,上網隨便找了個後台模板 ,又不想重複載入head,footer......

想到了用iframe , 隨便寫寫,歡迎大家指教

id=“nav_menu” 加在了二級菜單的 ul 上........

<script type="text/javascript">    //導航    $('#nav_menu a').click(function(){        //選中樣式        $(".am-fr").removeClass('am-icon-star');        $(this).children('.am-fr').addClass('am-icon-star');        //url        href = $(this).attr('href');        $('#iframe').attr('src',href);        return false;    });    //iframe是否載入完,並且隱藏捲軸    var iframe = document.getElementById("iframe");    if (iframe.attachEvent){      iframe.attachEvent("onload", function(){        hideS();      });    } else {      iframe.onload = function(){        hideS();      };    }    function hideS()    {      document.getElementById("iframe").scrolling="no";      document.getElementById("iframe").style.overflow="hidden";    }</script>
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.