很酷的横向无缝移动相册

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Wonsoft-网页特效-图片特效-很酷的横向无缝移动相册</title> <meta http-equiv="content-type" content="text/html;charset=gb2312"> <!--把下面代码加到<head>与</head>之间--> <mce:style type="text/css"><!-- body{background:#000;margin:0;font:12px Verdana;text-align:center;} #tbody{width:650px;margin:20px auto;text-align:left;} #mainbody{width:640px;margin:5px;border:1px solid #222;padding:1px} #mainphoto{cursor:pointer;display:block;} #goleft{float:left;clear:left;margin:6px 5px 0 3px;} #goright{float:right;clear:right;margin:6px 3px 0 5px;} #photos{width:610px;height:54px;line-height:54px;border:1px solid #222;margin:10px 0;overflow:hidden;} #showArea img{display:block;float:left;margin:1px 0;cursor:pointer;border:1px solid #222} .txt_1{font:bold 24px Verdana,Tahoma;color:#fff;} --></mce:style><style type="text/css" mce_bogus="1">body{background:#000;margin:0;font:12px Verdana;text-align:center;} #tbody{width:650px;margin:20px auto;text-align:left;} #mainbody{width:640px;margin:5px;border:1px solid #222;padding:1px} #mainphoto{cursor:pointer;display:block;} #goleft{float:left;clear:left;margin:6px 5px 0 3px;} #goright{float:right;clear:right;margin:6px 3px 0 5px;} #photos{width:610px;height:54px;line-height:54px;border:1px solid #222;margin:10px 0;overflow:hidden;} #showArea img{display:block;float:left;margin:1px 0;cursor:pointer;border:1px solid #222} .txt_1{font:bold 24px Verdana,Tahoma;color:#fff;}</style> </head> <body> <!--把下面代码加到<body>与</body>之间--> <div id="tbody"> <div id="mainbody"> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="640" height="400" id="mainphoto" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> </div> <img src="http://www.zzsky.cn/effect/images/200906021650/goleft.gif" mce_src="http://www.zzsky.cn/effect/images/200906021650/goleft.gif" width="11" height="56" id="goleft" /> <img src="http://www.zzsky.cn/effect/images/200906021650/goright.gif" mce_src="http://www.zzsky.cn/effect/images/200906021650/goright.gif" width="11" height="56" id="goright" /> <div id="photos"> <div id="showArea"> <!--SRC:缩略图地址,REL:大图地址,NAME:网址--> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/02.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/02.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/02.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/02.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/02.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/02.jpg" name="http://www.zzsky.cn" /> <img src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" mce_src="http://www.zzsky.cn/effect/images/200906021650/01.jpg" alt="数字图腾" width="80" height="50" rel="http://www.zzsky.cn/effect/images/200906021650/01.jpg" name="http://www.zzsky.cn" /> </div> </div> </div> <mce:script language="javascript" type="text/javascript"><!-- var browse = window.navigator.appName.toLowerCase(); var MyMar; var speed = 1;//速度,越大越慢 var spec = 1;//每次滚动的间距,越大滚动越快 var minOpa = 50;//滤镜最小值 var maxOpa = 100;//滤镜最大值 var spa = 2;//缩略图区域补充数值 var w = 0; spec = (browse.indexOf("microsoft") > -1) ? spec : ((browse.indexOf("opera") > -1) ? spec*10 : spec*20); function $(e) {return document.getElementById(e);} function goleft() {$('photos').scrollLeft -= spec;} function goright() {$('photos').scrollLeft += spec;} function setOpacity(e, n) { if (browse.indexOf("microsoft") > -1) e.style.filter = 'alpha(opacity=' + n + ')'; else e.style.opacity = n/100; } $('goleft').style.cursor = 'pointer'; $('goright').style.cursor = 'pointer'; $('mainphoto').onmouseover = function() {setOpacity(this, maxOpa);} $('mainphoto').onmouseout = function() {setOpacity(this, minOpa);} $('mainphoto').onclick = function() {location = this.getAttribute('name');} $('goleft').onmouseover = function() {this.src = 'http://www.zzsky.cn/effect/images/200906021650/goleft2.gif'; MyMar=setInterval(goleft, speed);} $('goleft').onmouseout = function() {this.src = 'http://www.zzsky.cn/effect/images/200906021650/goleft.gif'; clearInterval(MyMar);} $('goright').onmouseover = function() {this.src = 'http://www.zzsky.cn/effect/images/200906021650/goright2.gif'; MyMar=setInterval(goright,speed);} $('goright').onmouseout = function() {this.src = 'http://www.zzsky.cn/effect/images/200906021650/goright.gif'; clearInterval(MyMar);} window.onload = function() { setOpacity($('mainphoto'), minOpa); var rHtml = ''; var p = $('showArea').getElementsByTagName('img'); for (var i=0; i<p.length; i++) { w += parseInt(p[i].getAttribute('width')) + spa; setOpacity(p[i], minOpa); p[i].onclick = function() {location = this.getAttribute('name');} p[i].onmouseover = function() { setOpacity(this, maxOpa); $('mainphoto').src = this.getAttribute('rel'); $('mainphoto').setAttribute('name', this.getAttribute('name')); setOpacity($('mainphoto'), maxOpa); } p[i].onmouseout = function() { setOpacity(this, minOpa); setOpacity($('mainphoto'), minOpa); } rHtml += '<img src="' + p[i].getAttribute('rel') + '" mce_src="' + p[i].getAttribute('rel') + '" width="0" height="0" alt="" />'; } $('showArea').style.width = parseInt(w) + 'px'; var rLoad = document.createElement("div"); $('photos').appendChild(rLoad); rLoad.style.width = "1px"; rLoad.style.height = "1px"; rLoad.style.overflow = "hidden"; rLoad.innerHTML = rHtml; } // --></mce:script> </body> </html>

(from:http://www.zzsky.cn/effect/content/1675.htm)

你可能感兴趣的:(很酷的横向无缝移动相册)