我在我的網頁上有3幀,我需要一種方法來增加懸停事件上的幀大小,我該怎麼做? 這裏是我的代碼:我需要一種方法來增加懸停事件上的幀大小
<html>
<style ="text/css"> </style>
<frameset cols="33.3%,33.3%,33.3%">
<frame src="enter.html"> <frame src="prod.html">
<frame src="game.html"> </frameset>
我在我的網頁上有3幀,我需要一種方法來增加懸停事件上的幀大小,我該怎麼做? 這裏是我的代碼:我需要一種方法來增加懸停事件上的幀大小
<html>
<style ="text/css"> </style>
<frameset cols="33.3%,33.3%,33.3%">
<frame src="enter.html"> <frame src="prod.html">
<frame src="game.html"> </frameset>
你可以嘗試這樣的:
HTML
<frameset id="1" cols="33.3%,33.3%,*">
<frame src="page1.html" onmouseover="big()" onmouseout="small()"></frame>
<frame src="page2.html" onmouseover="big()" onmouseout="small()"></frame>
<frame src="page3.html" onmouseover="big()" onmouseout="small()"></frame>
</frameset>
的JavaScript第1頁
var e = document.getElementById("myframeset");
function big(){
e.setAttribute("cols","60%,20%,*")
}
function small(){
e.setAttribute("cols","33.3%,33.3%,*")
}
注意:您不會將JavaScript代碼放在包含框架集的頁面中。 JavaScript代碼應該相應放置在page1,page2和page3中。
Thankyou男人它爲我工作! – 2014-12-11 07:58:48
@ParthVerma你可以接受答案,如果它的工作.. – 2014-12-11 09:15:28
我試過用我的代碼,但它不工作。查看https://onedrive.live.com/redir?resid=FE2C9022D00ED02E%21954 – 2014-12-12 07:43:12
試試這個http://jsfiddle.net/9vsr0ybx/
iframe{
width:400px;
height:400px;
}
iframe:hover{
width:500px;
height:500px;
}
<風格= 「文本/ CSS」>
– 2014-12-11 04:41:26僅供參考..框架集不在支持HTML5 .. – 2014-12-11 05:10:57
http://stackoverflow.com/questions/11271764/how-to-change-dynamically -frame-size-on-mouse-over – 2014-12-11 05:32:26