[英]slide down menu in html frames
我想要html框架中的向下滑動菜單,當用戶單擊頂部框架中存在的按鈕時,它應該向下滑動我該如何創建框架
<!-- frameset is deprecated in html5, but it still works. -->
<frameset framespacing="0" rows="40,*,15" frameborder="1" noresize>
<frame name="top" src="http://www.yahoo.com" target="top"></frame>
<frame name="main" src="http://www.google.com" target="main"></frame>
<frame name="bottom" src="http://www.facebook.com" target="bottom"></frame>
</frameset>
我的要求是這樣的:
但我想在框架中實施
框架不適用於HTML5。 現在,已引入iframe。 您需要為每個iframe添加一個按鈕以顯示onclick。 以下是按鈕和iframe的代碼-
<button id ="b1" type="button">Click Me for Yahoo!</button>
<iframe id="yahoo" src="http://www.yahoo.com"></iframe><br>
<button id ="b2" type="button">Click Me for Google!</button>
<iframe id="google" src="http://www.google.com"></iframe><br>
<button id ="b3" type="button">Click Me for Facebook!</button>
<iframe id="facebook" src="http://www.facebook.com"></iframe><br>
現在,您需要像最初那樣使這些iframe隱藏在頁面加載中。 然后它們將出現在按鈕單擊上。
$(document).ready(function(){
$("#yahoo").hide();
$("#google").hide();
$("#facebook").hide();
$("#b1").click(function(){
$("#yahoo").show();
});
$("#b2").click(function(){
$("#google").show();
});
$("#b3").click(function(){
$("#facebook").show();
});
});
此代碼也將完美適用於框架。 我檢查過。 去嘗試一下。 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.