使用 JQuery 在新窗口中打开图像链接


    <script type="text/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();
            }, 8000); // autoclose after 8 seconds
        } else {
            console.log("PrettyPhoto is not defined."); // log this message
        }
    });
})(jQuery);
</script>

我正在尝试制作要在新标签窗口中打开的图像 (ad1.jpg( 链接网址。我该怎么做?我已经尝试了许多选项来完成这项工作。谢谢。

这应该有效!

<a target="_blank" href="http://your_url_here.html">Link</a>

希望这有助于更多详细信息,请参阅此处的答案 在新标签页或窗口中打开链接

最新更新