我已经升级到jQuery GalleryView 2.1.1,但似乎不支持图片上的ahref标签。是否有解决方法?我想在鼠标悬停在图像上时显示标题,并在单击后重定向到另一个页面。
我已经升级到jQuery GalleryView 2.1.1,但似乎不支持图片上的ahref标签。是否有解决方法?我想在鼠标悬停在图像上时显示标题,并在单击后重定向到另一个页面。
这是一个关于jQuery的演示页面,用于展示图片和链接。您可以在此网页上查看完整的代码和实现方式。
$('#gallery .panel img').hover(function() {
$(this).wrap('<a href="' + this.src + '" target="_blank"/>');
}, function() {
$(this).unwrap('<a></a>');
});
<li><span class="panel-overlay"><a href="your_link_here" ></a></span><img src="pic.jpg" alt=""/></li>
.panel .overlay-background { height: 666px; cursor:pointer;background: none; }
$(".panel-overlay").click(function() {
//get the link href
var link = jQuery("a", this).attr('href');
window.location.href = link;
});