⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thumb.js

📁 HomePlayer is an extention of the FreePlayer software provided by the french internet provider Free
💻 JS
字号:
PositionX = 10;
PositionY = 10;
defaultWidth = 600;
defaultHeight = 400;
var AutoClose = false;
function popupImage(){
  var url = this.src;
  var thumb = url.split("&size=460x460&cached=true");
  if (thumb.length > 1) {
    var imageURL = thumb[0];
    var imageTitle = (this.alt) ? this.alt : "image";
    var imgWin = window.open('','_blank','scrollbars=no,resizable=0,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
    if (!imgWin) { return true; }
    imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><script type="text\/javascript">\n'+
    'function resizeWinTo(url) {\n'+
    'if (!document.images.length) { document.images[0] = document.layers[0].images[0]; }\n'+
    'var oH = document.images[0].height, oW = document.images[0].width;\n'+   
    'if (!oH || window.doneAlready) { return; }\n'+
    'window.doneAlready = true;\n'+ //Safari & Opera
    'if(oH > screen.height){var SH = screen.availHeight ? screen.availHeight : screen.height; var SW = screen.availWidth ? screen.availWidth/2 : screen.width/2; var imageURL = url+"&size="+SW+"x"+SH+"&cached=true";oH = SH;oW = SW;var imageResized = document.getElementById("img-photo-resized");imageResized.src = imageURL}\n'+
    'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
    'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
    'if (x.innerWidth) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
    'else if (d && d.clientWidth) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
    'else if (b && b.clientWidth) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
    'if (window.opera && !document.childNodes) { myW += 16; }\n'+
    'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
    'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
    'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
    'if (!window.opera) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }\n'+
    '}\n'+
    '<\/script>'+
    '<\/head><body onload="resizeWinTo();"'+(AutoClose?' onblur="self.close();"':'')+'>'+
    (document.layers?('<layer left="0" top="0">'):('<div style="position:absolute;left:0px;top:0px;">'))+
    '<a href="javascript:window.opener.focus();window.close();" title="Cliquer sur la photo pour fermer la fenetre"><img src='+imageURL+' alt="Chargement..." title="" onload="resizeWinTo(this.src);" id="img-photo-resized" /></a>'+
    (document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
    imgWin.document.close();
    if (imgWin.focus) { imgWin.focus(); }
    return false;
  }
}
function showHand() { this.style.cursor = "pointer"; }

var image = document.getElementById('img-photo');

if(image !=null) {
 var thumb = image.src.split("&size=460x460&cached=true").length;
  if (thumb>1) {
    image.onclick = popupImage;
    image.onmouseover = showHand;
 }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -