单击 img 链接后,我有一个简单的幻灯片动画。客户端请求在新窗口/选项卡中打开链接。我尝试过window.open
或window.location = href;
使用该var href = this.href;
套装的每个选项都不起作用。
$("#coatings").click(function(event) {
event.preventDefault();
var href = this.href;
$("#sqeeguee_rightLink").fadeIn(100).animate({
right:'-=450px'
}, 2000,
function() {
window.location = href;
});
});
HTML:
<div id="sqeeguee_rightLink"></div>
<a href="url here" target="_blank" id="coatings"><img src="coatings.jpg" width="456" height="592" alt="" /></a>
任何输入都会很棒!