How to change dynamically frame size on mouse over

旧巷老猫 提交于 2019-12-11 08:12:18

问题


Can you tell me how we can change a frame size on mouse over?

eg:

<html>
<frameset rows="70%,30%">
<frame src="page1.htm">
<frame src="page2.htm">
</frameset>
</html>

On mouse over it should become like this:

<frameset rows="40%,60%">

And also is there any way we can do like this?

 <frameset rows="40%,60%"> ---> <frameset rows="70%,30%">  ---> <frameset rows="40%,60%">
 (after loading webpage;        (after 5 seconds)               (on mouse over)
     for 5 seconds)

回答1:


CODE:

<html>
<head>
<script>
var already=false;
var frameset;
window.onload=function(){frameset=document.getElementById("foo");};
setTimeout(modify,5000);
function modify()
{
    already=true;
    frameset.setAttribute("rows","70%,30%");
}
function big()
{
    if(already)frameset.setAttribute("rows","70%,30%");
}
function small()
{
    if(already)frameset.setAttribute("rows","40%,60%");
}
</script>
</head>
<frameset rows="40%,60%" id="foo" >
<frame src="page1.htm">
<frame src="page2.htm" onmouseover="small();" onmouseout="big();">
</frameset>
</html>



回答2:


You can use JQUERY to change frame Size. there is a effect Animation already defined in it. Its very easy to do with it.



来源:https://stackoverflow.com/questions/11271764/how-to-change-dynamically-frame-size-on-mouse-over

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!