This article brings you the content is about how to implement the HTML background navigation iframe Click-to-change URL (code), there is a certain reference value, the need for friends can refer to, I hope to help you.
Wrote a small project, the Internet casually find a background template, and do not want to repeatedly load head,footer ...
Think of using IFRAME, casually write, welcome everyone to advise
Id= "Nav_menu" added to the two-level menu of UL ....
<script type= "Text/javascript" >//Navigation $ (' #nav_menu a '). Click (Function ( {//Check style $ (". 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; }); Whether the IFrame is loaded and hides the scrollbar 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>