2014-08-27 55 views
1
<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)链接URL。我将如何做到这一点?我尝试了很多方法来完成这项工作。谢谢。用jQuery在新窗口中打开图像链接

+0

你想在一个新的标签页或弹出式窗口中打开它? – mencina 2014-08-27 15:05:19

+0

在新选项卡中打开。 – takashima 2014-08-27 15:12:34

+0

为什么你需要它在一个新的标签而不是一个窗口中打开? – littleswany 2014-08-27 15:28:38

回答