1、10 款动感图片展示 js 代码- 效果预览(10) body background: #222;overflow: hidden;left: 0;top: 0;width: 100%;height: 100%;margin: 0;padding: 0;#screen span position:absolute;overflow:hidden;border:#FFF solid 1px;background:#FFF;#screen imgposition:absolute;left:-32px;top:-32px;cursor: pointer;#caption, #titlecolor:
2、 #FFF;font-family: georgia, times new roman, times, veronica, serif;font-size: 1em;text-align: center;#caption b font-size: 2em;0 /* loop */setTimeout(“obj“ + o + “.zoom()“, 16);else/* finished */mv = false;/* set final position */if (s 0)l = ix * M + ix * Sx;t = iy * M + iy * Sy;w = Wi;h = Hi;elsel
3、 = x * M + x * Sx;t = y * M + y * Sy;w = Sx;h = Sy;/* html animation */with(spa)left = px(l);top = px(t);width = px(w);height = px(h);zIndex = Math.round(w);this.click = function()with(this)img_center(o);/* zooming logic */if ( ! mv | cl)if (s 0)if (cl | Math.abs(xm - xb) Sx * .4 | Math.abs(ym - yb)
4、 Sy * .4)s = - 2;mv = true;zoom();cap.innerHTML = txt;elseif (cl | ob != o)if (ob = 0)with(objob)s = - 2;mv = true;zoom();ob = o;s = 1;xb = xm;yb = ym;mv = true;zoom();cap.innerHTML = txt;/* hook up events */imgo.onmouseover = imgo.onmousemove = imgo.onmouseout = new Function(“cl=false;obj“ + o + “.
5、click()“);imgo.onclick = new Function(“cl=true;obj“ + o + “.click()“);imgo.onload = new Function(“img_center(“ + o + “)“);/* initial display */this.zoom();/* mouse */document.onmousemove = function(e)if ( ! e)e = window.event;xm = (e.x | e.clientX);ym = (e.y | e.clientY);/* init */function load()/*
6、html elements */scr = document.getElementById(“screen“);spa = scr.getElementsByTagName(“span“);img = scr.getElementsByTagName(“img“);cap = document.getElementById(“caption“);/* mouseover border */ document.getElementById(“border“).onmouseover = function()cl = true;if(ob = 0 ob = -1;/* global variabl
7、es */W = parseInt(scr.style.width);H = parseInt(scr.style.height);M = W / Mg;Sx = (W - (Nx - 1) * M) / Nx;Sy = (H - (Ny - 1) * M) / Ny;Wi = Tx * Sx + (Tx - 1) * M;Hi = Ty * Sy + (Ty - 1) * M;SP = M * Tx * SP;wi = (Wi - Sx) / SP;hi = (Hi - Sy) / SP;/* create objects */for (k = 0, i = 0; i carefully weight the options document.write(“);