我需要一些帮助。我正在尝试在新选项卡中打开图像(ad1.jpg)链接网址。我将如何做到这一点?我尝试了很多方法来完成这项工作。我可能会把代码放错了,但我试过window.open,还有更多选项。任何帮助是极大的赞赏。谢谢jquery javascript打开一个新的图像链接
(function($){
$(window).load(function(){
if(jQuery.isFunction(jQuery.fn.prettyPhoto)) {
$.prettyPhoto.open(
"images/ad1.jpg", // Image to be opened
"title", // Title of the pop-up
"desc." // The description
);
setTimeout(function() {
$.prettyPhoto.close();
}, 10000); // autoclose after 10 seconds
} else {
console.log("PrettyPhoto is not defined."); // log this message
}
});
})(jQuery);
这是行不通的。图片定义请看 HTML在那里不好。 – takashima 2014-08-27 19:10:56