我有一个html
<div class="portlet-header">
<a href="#" class="ui-icon ui-corner-all ui-state-default">
<span class="ui-icon ui-icon-minusthick ui-corner-all"></span>
</a>
</div>
我希望锚点具有悬停效果,因此我添加了以下 javascript:
$(".portlet-header").hover(function()
{
$(this).find("a")
.removeClass("ui-state-default")
.addClass("ui-state-hover");
},function(){……});
but the anchor's "ui-state-default" or "ui-state-hover" state doesn't work like this :
I want the effect like the jquery official ui dialog demo (yes,the theme is different)……
那么我该如何解决这个问题呢?制作右侧悬停效果
您可以使用 :hover 选择器在 CSS 中完全完成此操作。 IE:
.portlet-header a { ... };
.portlet-header a:hover { /* hover behavior */ }
根据您希望悬停发生的位置,您可以移动悬停线。当标题悬停时,以下内容将更改链接样式(而不仅仅是链接):
.portlet-header:hover a { ... }
如果使用 jQuery,您可以简化选择器:
$(".portlet-header a").hover();
这是等价的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)