我想在我的HTML模板列表中的StackOverflow(jQuery image hover color overlay)上使用jQuery效果。效果起作用,但不幸的是,链接不再点击进入下一页。jQuery点击叠加效果
的HTML标记是...
<ul class="rollover-effect">
<li><a href="page.html"><img src="image.jpg" alt="Image Title" /></a></li>
<li><a href="page.html"><img src="image.jpg" alt="Image Title" /></a></li>
<li><a href="page.html"><img src="image.jpg" alt="Image Title" /></a></li>
</ul>
...和我的jQuery的读取...
jQuery('ul.rollover-effect a').bind('mouseover', function(){
jQuery(this).parent('li').css({position:'relative'});
var img = jQuery(this).children('img');
jQuery('<div />').text(' ').css({
'height': img.height(),
'width': img.width(),
'background-color': 'black',
'position': 'absolute',
'top': 0,
'left': 0,
'opacity': 0.0,
'cursor': 'pointer'
}).bind('mouseout', function(){
jQuery(this).fadeOut(200, function(){
jQuery(this).remove();
});
}).insertAfter(this).animate({
'opacity': 0.40
}, 200);
});
任何人都可以看到或他们知道这可能是为什么?我希望能够点击进入下一页。它在扰乱我!谢谢。
它是否必须在'a'之上?如果不是,请将覆盖层设置为“z-index:1”,将“a”设置为“z-index:2” – Andy