注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

MOMO的成长

快乐多一点,笑容多一点,幸福多一点。。。

 
 
 

日志

 
 

在这纵向的JS相册效果  

2008-08-13 12:31:19|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="Author" content="懒人图库" />
<title>纵向的JS相册效果</title>
<style>
body {background:#000000;margin:20px 0;font:12px Verdana, Arial, Tahoma;text-align:center;vertical-align:middle;color:#FFFFFF}
img {border:none}
.txt_1 {font:bold 24px Verdana, Tahoma;color:#fff}
img.thumb_img {cursor:pointer;display:block;margin-bottom:10px}
img#main_img {cursor:pointer;display:block;}
#gotop {cursor:pointer;display:block;}
#gobottom {cursor:pointer;display:block;}
#showArea {height:355px;margin:10px;overflow:hidden}
.info {color:#666;font:normal 9px Verdana;margin-top:20px}
.info a:link, .info a:visited {color:#666;text-decoration:none}
.info a:hover {color:#fff;text-decoration:none}
</style>
</head>
<body>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="5">
  <tr>
    <td height="75" colspan="2" align="left" class="txt_1">纵向的JS相册效果</td>
  </tr>
  <tr>
    <td width="640" align="center"><img src="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" alt="懒人图库" width="640" height="400" border="0" id="main_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" link="http://www.makewing.com" /></td>
    <td width="110" align="center" valign="top">
    <img src="http://download.makewing.com/lanren/code/jsphotobook/images/gotop.gif" width="100" height="14" id="gotop" />
    <div id="showArea">
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/01.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/02.jpg" link="http://www.makewing.com" />
        <img src="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" alt="懒人图库" width="80" height="50" border="0" class="thumb_img" rel="http://download.makewing.com/lanren/code/jsphotobook/images/03.jpg" link="http://www.makewing.com" />
    </div>
    <img src="http://download.makewing.com/lanren/code/jsphotobook/images/gobottom.gif" width="100" height="14" id="gobottom" /></td>
  </tr>
</table>
</body>
</html>
<script language="javascript" type="text/javascript">
function $(e) {return document.getElementById(e);}
document.getElementsByClassName = function(cl) {
    var retnode = [];
    var myclass = new RegExp('\\b'+cl+'\\b');
    var elem = this.getElementsByTagName('*');
    for (var i = 0; i < elem.length; i++) {
        var classes = elem[i].className;
        if (myclass.test(classes)) retnode.push(elem[i]);
    }
    return retnode;
}
var MyMar;
var speed = 1; //速度,越大越慢
var spec = 1; //每次滚动的间距, 越大滚动越快
var ipath = 'http://download.makewing.com/lanren/code/jsphotobook/images/'; //图片路径
var thumbs = document.getElementsByClassName('thumb_img');
for (var i=0; i<thumbs.length; i++) {
    thumbs[i].onmouseover = function () {$('main_img').src=this.rel; $('main_img').link=this.link;};
    thumbs[i].onclick = function () {location = this.link}
}
$('main_img').onclick = function () {location = this.link;}
$('gotop').onmouseover = function() {this.src = ipath + 'gotop2.gif'; MyMar=setInterval(gotop,speed);}
$('gotop').onmouseout = function() {this.src = ipath + 'gotop.gif'; clearInterval(MyMar);}
$('gobottom').onmouseover = function() {this.src = ipath + 'gobottom2.gif'; MyMar=setInterval(gobottom,speed);}
$('gobottom').onmouseout = function() {this.src = ipath + 'gobottom.gif'; clearInterval(MyMar);}
function gotop() {$('showArea').scrollTop-=spec;}
function gobottom() {$('showArea').scrollTop+=spec;}
</script>
  评论这张
 
阅读(56)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018