特效介绍
jQuery相册
使用方法
1、在head引入相关的js文件和css文件,如下:
<link rel="stylesheet" type="text/css" href="../css/main.css" /> <link rel="stylesheet" type="text/css" href="ad-gallery.css" /> <script type="text/javascript" src="http://www.5imoban.net/download/jquery/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="jquery.ad-gallery.js"></script> <style type="text/css"> #gallery {padding:30px;background:#e1eef5;} </style> <script type="text/javascript"> $(function(){ $('.ad-gallery').adGallery(); //ad-gallery即相册外层的div });2、在需要使用该效果的地方加入下面的代码:
<div id="gallery" class="ad-gallery"> <div class="ad-image-wrapper"></div> <div class="ad-controls"></div> <div class="ad-nav"> <div class="ad-thumbs"> <ul class="ad-thumb-list"> <li><a href="images/a1.jpg"> <img src="images/thumbs/s1.jpg" title="衡山香客" alt="衡山香客" /> </a> </li> <li> <a href="images/a2.jpg"> <img src="images/thumbs/s2.jpg" alt="jQuery相册" title="jQuery相册" /> </a> </li> <li><a href="images/a3.jpg"> <img src="images/thumbs/s3.jpg" title="高塔耸立" alt="高塔耸立"/> </a> </li> <li><a href="images/a4.jpg"> <img src="images/thumbs/s4.jpg" title="Title for 4.jpg"/> </a> </li> <li><a href="images/a5.jpg"> <img src="images/thumbs/s5.jpg" title="朝鲜庆祝建党65周年烟火晚会" alt="朝鲜庆祝建党65周年烟火晚会"/> </a> </li> <li><a href="images/a6.jpg"> <img src="images/thumbs/s6.jpg" title="我爱模板网" alt="我爱模板网"/> </a> </li> <li><a href="images/a7.jpg"> <img src="images/thumbs/s7.jpg" title="网站模板" alt="网站模板"/> </a> </li> <li><a href="images/a8.jpg"> <img src="images/thumbs/s8.jpg" title="AD Gallery相册画廊" alt="AD Gallery相册画廊"/> </a> </li> </ul> </div> </div> </div>注意缩略图和大图要一一对应。