X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=js%2Fsyp.js;h=6c59dcdd3bbe55d5a7866530ae73eb0c879a3b33;hp=c3613873523bb999d0e220a896c81de7d7127475;hb=cb05788dc6a9bca81f5536143a7be3d1f6d36236;hpb=0fb779168df5af03f2a74b6bf1766d5a1c0f1a7e diff --git a/js/syp.js b/js/syp.js index c361387..6c59dcd 100644 --- a/js/syp.js +++ b/js/syp.js @@ -253,10 +253,6 @@ var SYP = { document.getElementById('bigimg').style.maxHeight = maxHeight + "px"; document.getElementById('bigimg').style.maxWidth = maxWidth + "px"; document.getElementById('bigimg').onload = function () { - var icon = document.getElementById('bigimg_close'); - icon.style.top = this.offsetTop; - icon.style.left = this.offsetLeft + this.clientWidth - icon.clientWidth; - var heightRatio = this.clientHeight / parseInt(this.style.maxHeight); var widthRatio = this.clientWidth / parseInt(this.style.maxWidth); if (heightRatio > 1 || widthRatio > 1) { @@ -267,6 +263,10 @@ var SYP = { } } + var icon = document.getElementById('bigimg_close'); + icon.style.top = this.offsetTop; + icon.style.left = this.offsetLeft + this.clientWidth - icon.clientWidth; + }; document.getElementById('bigimg').src = href; },