解決多個iframe嵌套而造成的多個滾動條問題


css:html{
    overflow:hidden;
   }

script:function adjustIfHt(){
    var ht = $(window).height();//獲取瀏覽器窗口的整體高度;
    var topHeader = 60;//獲取頭部高度,定義一個變量名為topHeader
    // $(".sidebar").height(ht);
    $("#detail").height(ht-topHeader);
  },要記得引入jquery文件。

html:<iframe id="detail" src="studentInfo/abstract.html">
  
 </iframe>

在body最后面加<script type="text/javascript">adjustIfrHt();</script>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM