Français
<!-- website:http://www.downcodes.com --> <!-- bbs:http://bbs.downcodes.com --> <!-- Le code HTML complet est le suivant --> <html > <head> <title>Un effet d'affichage d'image similaire à celui produit par Flash</title> <meta name="Author" content="http://www.downcodes.com"> <meta http-equiv= "imagetoolbar" content="no"> <style type="text/css"> body {cursor:crosshair;margin:0; padding:0; position:overflow:hidden;left:0; haut:0 ; largeur:100%; hauteur:100%;zIndex:-2;} </style> <script type="text/javascript"><!-- // ========== === ======================================= // http://www. downcodes.com // Version DOM : 2005.4 // ======================================== ===== ========== window.onerror = new Function("return true"); screen.bufferDepth = 16; document.onselectstart = function () { return false } //// ///// ////////////////// var NX = 3; var NY = 3; var SP = 20; var DÉLAI = 96; ////// //////////////// var objet = new Array(); var nI = 0; var run = false; 1; var iW = 0; var iH = 0; var oH = 0; fonction CObj(N,y,x){ this.obj = document.createElement("span"); = new Function("object[ "+N+"].GE1()"); this.obj.onmousedown = new Function("return false;"); this.obj.style.cursor = "pointeur" this.obj; .style.position = "absolu"; this.img = document.createElement("img"); this.img.style.position = "absolu"; this.img.src = IMGSRC[N%nI].src this; .obj.appendChild(this.img); IMGBOX.appendChild(this.obj); this.object = new Array(); 0; this.H = 0 ; this.L = 0; this.T = 0; function CImg(Parent,y,x){ this.Parent = This.obj = document.createElement("span"); .obj.style.position= "absolu"; this.obj.style.overflow="hidden"; this.obj.style.cursor = "pointeur"; this.img = document.createElement("img"); img.style.position = " absolu"; this.img.src = IMGSRC[N%nI].src; this.obj.appendChild(this.img); .N = Parent.N; ceci.x = x; ceci.y = y; ceci.W = 0; ceci.L = 0; .dy = 0; ceci px = 0; ceci.dw = 0; ceci.pw = 0; = 0; this.idx = 0; this.idy = 0; this.GE2 = function (){ avec(this){ px -= dx * py -= dy * dR; += dh * dR; ipx -= idx * dR; -= idy * dR; avec(obj.style){ gauche = Math.round(px); (pw)+1; hauteur = Math.round(ph)+1; if(dR==-1)if(pw<=W+1)obj.style.visibility="caché" } avec(img.style; ){ gauche = Math.round (ipx-oW); top = Math.round(ipy-oH); if(++xrun>=NX*NY*SP){ xrun=0; ==-1)Parent.obj.style.zIndex = 0; dR = -dR; } } } this.GE1 = fonction (N1,N2){ avec(this){ if(dR==1){ px = L ; py = T; dx = ((Parent.L + L) - (x * Parent.W)) / SP dy = ((Parent.T + T) - (y * Parent.H)) / SP; = W; ph = H; dw = (Parent.W - W) / SP; dh = (Parent.H - H) / SP; ) - L) / SP; idy = ((y * Parent.H) - T) / SP } obj.style.visibility="visible"; .height-document.body.offsetHeight)/2; sinon oH = 0; if(img.width>document.body.offsetWidth/2)oW=(img.width-(document.body.offsetWidth/2))/2 ; sinon oW = 0; for (i=0;i<SP;i++) setTimeout("object["+N1+"].object["+N2+"].GE2()",16*i } } this .DOOT = function (){ avec(this){ W = Parent.W / NX; H = Parent.H / NY; var i=0;i< NY;i++) for(var j=0;j<NX;j++) this.object[k++] = new CImg(this,i,j); this.GE1 = function (){ avec (this){ if(! run){ TXTBOX.innerHTML = "<div style='margin:2%'>"+TXTSRC[N%nI].innerHTML+"</div>"; .zIndex = 1; pour( var i=0;i<NX*NY;i++) setTimeout("object["+N+"].object["+i+"].GE1("+N+","+i+" )",i*DELAY) ; } } } this.DOOT = function (){ with(this){ if(img.width<iW)iW=img.width; if(img.height<iH)iH=img. hauteur; avec(obj.style ){ W = largeur = iW / NX; H = hauteur = iH / NY; L = gauche = x * T = haut = y * H; = W; hauteur = H; } for(var i in object) object[i].DOOT(); } } } onload = function() { IMGSRC = document.getElementById("imgsrc").getElementsByTagName("img") ; TXTSRC = document.getElementById( "txtsrc").getElementsByTagName("div"); IMGBOX = document.getElementById("imgbox"); ); iH = document.body .offsetHeight; iW = document.body.offsetWidth/2; nI = IMGSRC.length; for(var i=0;i<NY;i++){ for(var j= 0;j<NX;j++ ){ objet[k] = new CObj(k,i,j); objet[k++].DOOT(); } } IMGBOX.style.width = iW; ; TXTBOX.style.width = iW; TXTBOX.style.height = iH; TXTBOX.style.left = iW; TXTBOX.style.visibility="visible"; -iH/2; } / /--> </script> </head> <body> <div style="position:absolute;left:50%;top:50%;"><div id="center" style="position:absolute; "> <div id="imgbox" style="position:absolute;left:0;top:0;overflow:hidden;"></div> <div id="txtbox" style= "position: absolue; visibilité: cachée; débordement: caché; arrière-plan: #333; couleur: #FFF; font-family: verdana; font-size: 0.8em;"> <div style="margin:2%"> < h2>IMGBOX</h2> Cliquez sur les vignettes à gauche pour agrandir l'image. La description liée à l'image cliquée s'affiche ici.<br> <br>Remarque : pour des raisons de performances, les images ne sont pas redimensionnées et doivent être toutes entières. la même taille </div > </div> </div></div> <div id="imgsrc" style="visibility:hidden"> <img src=""> <img src=""> < img src=""> < img src=""> <img src=""> <img src=""> <img src=""> <img src=""> <img src=""> </ div> <div id=" txtsrc" style="visibility:hidden"> <div> <h2>la rivière</h2><br>Je me réveille de ma sieste au bord de la rivière </div> <div> <h2>transparence </h2><br> Sa transparence était hypnotisante </div> <div> <h2>froide</h2><br>Des courants d'eau froide jouaient avec la lumière </div> <div> <h2>s'enfonçaient. </h2><br> J'ai jeté quelques noix dans la rivière. Elles ont flotté un moment, puis ont coulé. </div> <div> <h2>masquées</h2><br>Un large tremplin masquait la rivière. la profondeur de l'eau. </div> <div> <h2>un aperçu</h2><br>Plus tard, j'ai eu un aperçu du lit de la rivière. </div> <h2>oublié</h2><. br>Le fauteuil roulant faisait du bruit. Encore une fois, j'avais oublié mes jambes. </div> <div> <h2>flottait</h2><br>Pourtant, je flottais dans l'oubli des choses trop réelles. <div> <h2>pour moi</h2><br>Je regardais fixement les bras ouverts de l'eau. Le ruisseau chantait pour moi </div> </div> <!-- crossbrowser images_loading_bar - Gerard Ferrandez - www. .dhteumeuleu.com - février 2005 --> <span id=LB0 style="position:absolute;left:50%;top:50%;"><span style="position:absolute;font-family:arial;font -size:10px;color: #FFFFFF;left:-50;top:-18">Chargement...</span> <span style="position:absolute;left:-50;top:-5;font- taille:1px;largeur:100 ;hauteur:10px;arrière-plan:#333"><span id=LB1 style="position:absolute;left:0;top:0;font-size:1px;largeur:0;hauteur : 10px;background:#FFFFFF" ></span></span></span> <script>m00=document.getElementById("imgsrc").getElementsByTagName("img");m01=m00.length;function images_loading_bar( ){m02=0;for (i=0;i<m01;i++)m02+=(m00[i].complete)?1:0;document.getElementById("LB1").style.width=Math.round( m02/m01*100); if(m02==m01)setTimeout("document.getElementById('LB0').style.display='none'",128); };images_loading_bar();< /script> <!-- fin du code images_loading_bar --> </body> </html>