使用JQuery在新窗口中打开图像链接 [英] Open image link in new windows with JQuery

查看:72
本文介绍了使用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)链接网址窗口。我将如何做到这一点?我尝试了很多方法来完成这项工作。感谢。

I am trying to make an image (ad1.jpg) link url to be opened in a new tab window. How would I do this? I have tried many options to make this work. Thanks.

推荐答案

这应该可以解决!

This should work!

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

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

Hope this helps for more detail see the answer here Open link in new tab or window

这篇关于使用JQuery在新窗口中打开图像链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆