我有一个
<div>
里面有两个浮动元素。我正在使用jquery将Click事件处理程序附加到此
<DIV & GT;
. 只有当我单击两个浮动元素中的一个时,才会调用该处理程序。里面的空位
<DIV & GT;
不起作用。
标记如下所示:
<div class="wrapper">
<h4>Some lovely header text here</h4>
<img src="images/plus.png"/>
<div style="clear: both;"/>
</div>
这是我的javascript(我也在使用其他事件):
scenario_header.live("click", function() {
$(this).toggleClass("expanded");
$("+ div", this).slideToggle();
});
scenario_header.live("mouseover", function() {
$(this).toggleClass("hover");
});
scenario_header.live("mouseout", function() {
$(this).toggleClass("hover");
});
这在Firefox中非常有效。有什么想法吗?