当鼠标悬停在使用jQuery的鼠标上时,如何缩放<h3>
标记的文本?将鼠标悬停在鼠标上
这是JavaScript代码。
var bindBehaviors = function (scope) {
$('h3',scope).hover(
function() {
$(this).css("font-size", "40px");
},
function() {
$(this).css("font-size", "25px");
}
);
}
bindBehaviors(this);
它正在改变其大小,但是当我把鼠标放到其中包含<h3>
文本行的任何地方它正在发生。为什么? 另一个问题是定位。
ASPX代码如下。
<form id="form1" runat="server">
<div id="dictionary">
</div>
<div class="letters">
<div class="button" id="letter-a">
<h3>A</h3>
<button type="button">Load</button>
</div>
<div class="button" id="letter-b">
<h3>B</h3>
<button type="button">Load</button>
</div>
<div class="button" id="letter-c">
<h3>C</h3>
<button type="button">Load</button>
</div>
<div class="button" id="letter-d">
<h3>D</h3>
<button type="button">Load</button>
</div>
</div>
<div class="button" id="letter-f">F
<form>
<input type="text" name="term" value="" id="term" />
<input type="submit" name="search" value="search" id="search" />
</form>
</div>
<div id="loading">
Loading...
</div>
</form>
只需增加字体。这可以用css'h3:hover {font-size:50px; }' – elclanrs 2012-08-10 07:34:55
试试这个插件http://janne.aukia.com/zoomooz/ – undefined 2012-08-10 07:35:23