1. 程式人生 > >【html】點擊鏈接讓頁面在 iframe 中變換

【html】點擊鏈接讓頁面在 iframe 中變換

pan dex fff tar html order get eight 鏈接

Demo:

<html><body>


<a href= "1.html " target= "iFrameName "> page1 </a> <br/>
<a href= "2.html " target= "iFrameName "> page2 </a> <br/>
<a href= "3.html " target= "iFrameName "> page3 </a> <br/>
<a href= "4.html " target= "iFrameName "> page4 </a> <br/>


<div id= "iFrame1 " style= "position:absolute; left:220px; top:200px; z-index:18 ">
<iframe name= "iFrameName " width=542 height=615 src= "1.html " scrolling= "auto " frameborder= "0 "> </iframe>
</div>

</body> </html>

主要是在iframe裏定義name=XXX ,然後在href裏用 target調target=XXX

【html】點擊鏈接讓頁面在 iframe 中變換