(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);
我需要一些幫助。我正在嘗試在新選項卡中打開圖像(ad1.jpg)鏈接網址。我將如何做到這一點?我嘗試了很多方法來完成這項工作。我可能會把代碼放錯了,但我試過window.open,還有更多選項。任何幫助是極大的讚賞。謝謝!jquery用張貼的代碼打開新的圖像鏈接
在你的代碼中你想打開一個新標籤? – jvecsei 2014-08-27 20:24:45
此代碼位於index.html文件的頁腳中。啓動域時,代碼會正確顯示消息,但在單擊新標籤中的URL時需要該圖像。 – takashima 2014-08-27 20:29:22
你目前觀察到了什麼行爲(鏈接是否在同一個標籤中打開?它不能在任何地方打開?)?什麼是相關的HTML? – jtheletter 2014-08-27 20:38:36