【问题标题】:i need a way to increase the size of a frame on hover event,我需要一种方法来增加悬停事件的框架大小,
【发布时间】:2014-12-11 04:41:14
【问题描述】:

我的网页上有 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 css


【解决方案1】:

你可以这样尝试:

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>

第1页的Javascript

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中。

【讨论】:

【解决方案2】:

试试这个http://jsfiddle.net/9vsr0ybx/

iframe{
width:400px;
height:400px;
}

iframe:hover{
width:500px;
height:500px;
}

【讨论】:

  • 我可以用框架而不是 i 框架来做吗?
  • @ParthVerma 你能用框架展示一个工作小提琴吗?
  • @ParthVerma 使用 iframe 更好
  • @ParthVerma 不在 jsfiddle 上?你的意思是它不工作?
猜你喜欢
  • 2013-12-28
  • 2017-03-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多