»
AnglaisFran�aisVietnamien

Imprimer - Auto-image diminution - JavaScriptBank.com

Version compl�te: jsB@nk » Image » Auto-image diminution
URL: https://www.javascriptbank.com/auto-decrease-image.html

Auto-image diminution © JavaScriptBank.comOriginal image sont de grande taille alors se réduire à la taille zéro automatiquement.

Version compl�te: jsB@nk » Image » Auto-image diminution
URL: https://www.javascriptbank.com/auto-decrease-image.html



JavaScript
<SCRIPT><!-- Beginning of JavaScript -// Chieu rong cua anh (pixels). Tat ca anh co cung chieu rong nayvar imgwidth=240// Chieu cao cua anh (pixels). Tat ca cac anh co cung chieu cao nayvar imgheight=160// Vi tri anh se xuat hien (pixels). var pos_left=10var pos_top=10// ten cac anh,co the them anhvar imgname=new Array()imgname[0]="logojs.gif"// lien ket se den khi nhap vao anhvar imgurl=new Array()imgurl[0]="http://jsbank.topcities.com"// bien nay se co tac dung bat dau lai hieu ung khi thuc hien het anhvar imgpreload=new Array()for (i=0;i<=imgname.length-1;i++) {imgpreload[i]=new Image()imgpreload[i].src=imgname[i]}// thoi gian dung lai giua cac anh (microseconds).var pause=2000// toc do thuc hien hieu ung. So cang lon thi toc do cang chamvar speed=20// toc do chuyen moi frame anh, so cang lon thi toc do cang nhanhvar step=10// dung chinh sua nhung bien sauvar cliptop=0var clipbottom=imgheightvar clipleft=0var clipright=imgwidthvar i_loop=4*imgwidthvar i_image=0function shrinkin() {if (i_loop>=imgwidth) {    imgcontainer.innerHTML="<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' src='"+imgname[i_image]+"' border='0'></a>"i_loop=i_loop-stepvar timer=setTimeout("shrinkin()",speed)  }else {clearTimeout(timer)var timer=setTimeout("shrinkout()",pause)}}function shrinkinNN() {if (i_loop>=imgwidth) {        document.imgcontainer.document.write("<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' src='"+imgname[i_image]+"' border='0'></a>")        document.imgcontainer.document.close()i_loop=i_loop-step*10var timer=setTimeout("shrinkinNN()",speed*40)  }else {clearTimeout(timer)var timer=setTimeout("shrinkoutNN()",pause)}}function shrinkout() {if (i_loop>-step) {        imgcontainer.innerHTML="<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' src='"+imgname[i_image]+"' border='0'></a>"i_loop=i_loop-stepvar timer=setTimeout("shrinkout()",speed)  }else {clearTimeout(timer)changeimage()}}function shrinkoutNN() {if (i_loop>-step) {         document.imgcontainer.document.write("<a href='"+imgurl[i_image]+"' target='_blank'><img width='"+i_loop+"' src='"+imgname[i_image]+"' border='0'></a>")        document.imgcontainer.document.close()i_loop=i_loop-step*10var timer=setTimeout("shrinkoutNN()",speed*40)  }else {clearTimeout(timer)         document.imgcontainer.document.write("<a href='"+imgurl[i_image]+"' target='_blank'><img width='1' src='"+imgname[i_image]+"' border='0'></a>")        document.imgcontainer.document.close()changeimageNN()}}function changeimage() {i_loop=4*imgwidthi_image++if (i_image>imgname.length-1) {i_image=0}   var timer=setTimeout("shrinkin()",pause)}function changeimageNN() {i_loop=4*imgwidthi_image++if (i_image>imgname.length-1) {i_image=0}   var timer=setTimeout("shrinkinNN()",pause)}function initiate() {if (document.all) {document.all.imgcontainer.style.posLeft=pos_leftdocument.all.imgcontainer.style.posTop=pos_top        document.all.imgcontainer.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"changeimage()}if (document.layers) {document.imgcontainer.left=pos_leftdocument.imgcontainer.top=pos_top        document.imgcontainer.clip.left=clipleft        document.imgcontainer.clip.right=clipright        document.imgcontainer.clip.top=cliptop        document.imgcontainer.clip.bottom=clipbottomchangeimageNN()}}// - End of JavaScript - --></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=initiate()><SPAN id=imgcontainer style="POSITION: relative"></SPAN></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->