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

使用JQuery在新窗口中打开图像链接,jquery,html,Jquery,Html,我试图使一个图像ad1.jpg链接url在一个新的选项卡窗口中打开。我该怎么做?我尝试了很多方法来实现这一目标。谢谢。这应该有用 <script type="text/javascript"> (function($){ $(window).load(function(){ if(jQuery.isFunction(jQuery.fn.prettyPhoto)) { $.prettyPhoto.open(

我试图使一个图像ad1.jpg链接url在一个新的选项卡窗口中打开。我该怎么做?我尝试了很多方法来实现这一目标。谢谢。

这应该有用

    <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>

希望这有助于了解更多详细信息请参见此处的答案

是否要在新选项卡或弹出窗口中打开它?为什么需要在新选项卡而不是窗口中打开它?这只是html而不是js
<a target="_blank" href="http://your_url_here.html">Link</a>