答案 0 :(得分:2)
我认为您需要使用jquery方法ul
并将.stopPropagation()
替换为mouseenter
,将mouseover
替换为mouseleave
mouseout
var ids = ['test','wrapper'];
$.each(ids, function(index, value) {
$('.' + value)
.mouseover(function(event) {
event.stopPropagation();
$(this).css('-webkit-box-shadow', 'inset 0px 0px 0px 4px rgba(255,248,41,1)');
$(this).css('-moz-box-shadow', 'inset 0px 0px 0px 4px rgba(255,248,41,1)');
$(this).css('box-shadow', 'inset 0px 0px 0px 4px rgba(255,248,41,1)');
$(this).css('cursor','pointer');
})
.mouseout(function() {
$(this).css('-webkit-box-shadow', '');
$(this).css('-moz-box-shadow', '');
$(this).css('box-shadow', '');
$(this).css('cursor','default');
});
});
.wrapper
{
width:300px;
height:300px;
background:#888;
padding:50px;
}
.test
{
background:#fff;
}