自己写来用的,第一版草稿源码+效果图,功能优先,其他的再说,有时间再改进。

 <script src="http://common.cnblogs.com/script/jquery.js" type="text/javascript"></script>

 <script type="text/javascript">

     //only show 9 img on the list
var imgTotal=8; //when click the img list show the selected img
function NavImgClick(obj)
{
$("#navlist li:visible img").each(function(){
if($(this).parent().is("div"))
$(this).unwrap();
});
var img=$(obj).attr("src");
$("#big_photo").attr("src",img);
$(obj).wrap("<div style='width:61px;height:61px;border:2px solid #C6C6C6;'></div>"); //set the current index
$("#navlist").attr("currentimg",$(obj).attr("imgIndex")); } function PreviousNext(dir)
{
//left 9 img list on the page, other hidden
var currentImg=$("#navlist li:visible img[imgIndex="+($("#navlist").attr("currentimg")||0)+"]");
var currentImgIndex=parseInt(currentImg.attr("imgIndex"));
var firstImgIndex=parseInt($("#navlist li:visible img").eq(0).attr("imgIndex"));
//judge if the first or the last img in the list
var imgCount=currentImgIndex-firstImgIndex; //dir 1 and -1
if(dir==1)
{
//dir 1 next one
if(currentImg.parent().is("div"))
{
if(currentImg.parent().parent().next().length>0)
{
if(imgCount==imgTotal)
{
$("#navlist li:visible").first().hide();
$(".prevBtn").removeAttr("disabled");
}
$(".nextBtn").removeAttr("disabled");
NavImgClick($("#navlist li:visible img[imgIndex="+(currentImgIndex+1)+"]"));
}
else
{
//disable the next button
$(".nextBtn").attr("disabled",true);
}
}
}
else
{
//dir -1 previous one
if(currentImg.parent().is("div"))
{
if(currentImg.parent().parent().prev().length>0)
{
if(imgCount==0)
{
$("#navlist li:hidden").last().show();
$(".nextBtn").removeAttr("disabled");
}
$(".prevBtn").removeAttr("disabled");
NavImgClick($("#navlist li:visible img[imgIndex="+(currentImgIndex-1)+"]"));
}
else
{
$(".prevBtn").attr("disabled",true);
}
}
}
} //onload init the first img
$(function(){
NavImgClick($("#navlist li img").eq(0));
}); </script> <table style="">
<tr>
<td style="width:30px;"><button class="prevBtn" onclick="PreviousNext(-1)"><<</button></td>
<td align="center" valign="middle">
<div style="width:630px;height:660px;border:1px solid gray;">
<table style="text-align:center;width:100%;height:100%;">
<tr>
<td style="text-align:center;vertical-align:middle;">
<img id="big_photo" style="display:inlie-block;max-width:620px;max-height:650px;" src="http://m2.img.srcdd.com/farm4/d/2013/0907/09/1A55F2AC89AE00EBC4973D36FA62749E_B1280_1280_waef6_500_666.JPEG"/>
</td>
</tr>
</table>
</div>
</td>
<td style="width:30px;"><button class="nextBtn" onclick="PreviousNext(1)">>></button></td>
</tr>
<tr>
<td style="width:30px;"><button class="prevBtn" onclick="PreviousNext(-1)"><<</button></td>
<td>
<ul id="navlist" currentimg="0" style="list-style:none;display:block;overflow:hidden;width:605px;height:65px;padding:5px;white-space:nowrap;">
<li style="display:inline-block;"><img onclick="NavImgClick(this,0)" imgIndex=0 style="width:60px;height:60px;" src="http://m3.img.srcdd.com/farm4/d/2013/0218/17/361180C17EB5486F928E3BCF6155D847_B1280_1280_waef6_500_666.JPEG"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,1)" imgIndex=1 style="width:60px;height:60px;" src="http://m2.img.srcdd.com/farm4/d/2013/0907/09/1A55F2AC89AE00EBC4973D36FA62749E_B1280_1280_waef6_500_666.JPEG"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,2)" imgIndex=2 style="width:60px;height:60px;" src="http://m3.img.srcdd.com/farm5/d/2013/1111/11/ABD8A40775BD2C2A8F69D2F389556C0A_B1280_1280_wb771_757_600.jpeg"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,3)" imgIndex=3 style="width:60px;height:60px;" src="http://m2.img.srcdd.com/farm4/d/2014/0805/21/1B966394AAC8AA67A78C930A96072B33_B1280_1280_450_600.jpeg"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,4)" imgIndex=4 style="width:60px;height:60px;" src="http://m3.img.srcdd.com/farm5/d/2014/0805/21/810A43130E01113A1C70968845D80DF9_B1280_1280_450_600.jpeg"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,5)" imgIndex=5 style="width:60px;height:60px;" src="http://m2.img.srcdd.com/farm5/d/2014/0805/21/42E06319A08491791C77E3A67E597DD4_B500_900_500_703.jpeg"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,6)" imgIndex=6 style="width:60px;height:60px;" src="http://m3.img.srcdd.com/farm5/d/2014/0805/18/142990BECE7E22BBF6F228389F931AAA_B800_2400_565_1000.jpeg"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,7)" imgIndex=7 style="width:60px;height:60px;" src="http://m3.img.srcdd.com/farm4/d/2014/0805/18/192B2AF73BF777C4F76755EA600DE764_B1280_1280_500_750.jpeg"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,8)" imgIndex=8 style="width:60px;height:60px;" src="http://m3.img.srcdd.com/farm4/d/2013/0218/17/361180C17EB5486F928E3BCF6155D847_B1280_1280_waef6_500_666.JPEG"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,9)" imgIndex=9 style="width:60px;height:60px;" src="http://m2.img.srcdd.com/farm4/d/2013/0907/09/7ED74130F8227451CB69A6837A27138D_B500_900_waef6_500_750.JPEG"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,10)" imgIndex=10 style="width:60px;height:60px;" src="http://m2.img.srcdd.com/farm4/d/2013/0907/09/7ED74130F8227451CB69A6837A27138D_B500_900_waef6_500_750.JPEG"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,11)" imgIndex=11 style="width:60px;height:60px;" src="http://m2.img.srcdd.com/farm4/d/2013/0907/09/7ED74130F8227451CB69A6837A27138D_B500_900_waef6_500_750.JPEG"></li>
<li style="display:inline-block;"><img onclick="NavImgClick(this,12)" imgIndex=12 style="width:60px;height:60px;" src="http://m2.img.srcdd.com/farm4/d/2013/0907/09/7ED74130F8227451CB69A6837A27138D_B500_900_waef6_500_750.JPEG"></li>
</ul>
</td>
<td style="width:30px;"><button class="nextBtn" onclick="PreviousNext(1)">>></button></td>
</tr>
</table>

js相册展示的更多相关文章

  1. PhotoSwipe.js 相册展示插件学习

    PhotoSwipe.js官网:http://photoswipe.com/,在这个网站上可以下载到PhotoSwipe的文件以及相关的例子. 这个组件主要是用来展示图片.相册用的,还是很实用的. 一 ...

  2. js和CSS3炫酷3D相册展示

    <!doctype html> <html> <head> <meta charset="UTF"> <title>js ...

  3. QQ空间相册展示特效

    <!doctype html> <html lang="en"> <head> <title>QQ空间相册展示特效<title ...

  4. TouchPoint.js – 可视化展示 HTML 原型点击效果

    TouchPoint.js 是一个用于 HTML 原型展示的 JavaScript 库(作为UX过程的一部分),通过视觉表现用户在屏幕上的点击.TouchPoint 是高度可定制,非常适合屏幕录制,用 ...

  5. Objective-c——UI基础开发第十二天(相册展示)

    一.知识点 模仿新特性 UICollectionViewFlowLayout自定义布局 相册 瀑布流(淘宝购物之类的 二.复习 a.UICollectionView 和 tableview共享一套AP ...

  6. java+js实现展示本地文件夹下的所有图片demo[申明:来源于网络]

    java+js实现展示本地文件夹下的所有图片demo[申明:来源于网络] 地址:http://blog.csdn.net/allgis/article/details/46364875

  7. js文字展示各种滚动效果

    js文字展示各种滚动效果:http://www.dowebok.com/demo/188/

  8. java后台获取和js拼接展示信息

    java后台获取和js拼接展示信息: html页面代码: <div class="results-bd"> <table id="activityInf ...

  9. 3d相册展示

    示例代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta ...

随机推荐

  1. android开发中在界面上实现曲线图的几个开源项目

    转自:https://wapiknow.baidu.com/question/1959128379041474620?qq-pf-to=pcqq.c2c 几个相关开源项目: 1.  MPAndroid ...

  2. 特征处理(Feature Processing)

    [本文链接:http://www.cnblogs.com/breezedeus/p/4109456.html,转载请注明出处] 我的博客主营地迁至github,欢迎朋友们有空去看看:http://br ...

  3. Unity and C#: Game Loop (Awake, Start, Update)

    Introduction The central component of any game, from a programming standpoint, is the game loop. It ...

  4. Android中的requestWindowFeature

    朋友推荐使用博客记录工作中的难点以及常犯的错误,仅作为笔记,首先整理之前的工作日志. requestWindowFeature(featrueId),它的功能是启用窗体的扩展特性: 注意:该方法必须放 ...

  5. wp学习计划!

    对wp兴趣很大,可真正学习时,目的性就很不明确了,其实这有两大问题阻碍着,一是自身的基础还不够扎实,二是学习资料不好找,前者只能慢慢积累,而后者却是可以改变的,现在我的主阵营是channel 9上的w ...

  6. Hibernate component mapping

    A Component is a containted object that is be persisted value type and not an entity.But you can emb ...

  7. 我和Java有个约定

    2012年8月31日,我在父亲的陪伴下,第一次登上的火车,千里迢迢从老家来到了现代化大都市--西安,目睹着这里的繁华,与从小生活的环境截然的天壤之别,蓦然间问自己,你确定这是想来的地方吗? 依稀记得曾 ...

  8. zookeeper 的多线程和单线程库使用对比

    zookeeper提供了两个库,zookeeper_st和 zookeeper_mt. 前者是单线程库,仅仅提供了异步API和集成在应用程序实现循环中的回调函数,这个库是为了支持pthread库不支持 ...

  9. 给 admin 新建的 hdfs 文件的权限

    su hdfs hdfs dfs -chown -R admin /   org.apache.hadoop.security.AccessControlException: Permission d ...

  10. Oracle expdp/impdp导出导入命令及数据库备份

    使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ...