📌  相关文章
📜  使用 window.open 在浏览器中打开适合屏幕的图像 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:45.580000             🧑  作者: Mango

代码示例1
$(".view-full-size").click(function() {

  var mainScreenshot = $("#main-screenshot");
    
  var theImage = new Image();
  theImage.src = mainScreenshot.attr("src");
    
  var winWidth = theImage.width + 20;
  var winHeight = theImage.height + 20;
    
  window.open(this.href,  null, 'height=' + winHeight + ', width=' + winWidth + ', toolbar=0, location=0, status=0, scrollbars=0, resizable=0'); 
    
  return false;
    
});