相册展示
Galleriffic-jquery图片画廊插件
插件网址:http://www.twospy.com/galleriffic/index.html
使用方法
引入JQ库与插件js
<link rel="stylesheet" href="css/basic.css" type="text/css" /><link rel="stylesheet" href="css/galleriffic-3.css" type="text/css" /><script type="text/javascript" src="js/jquery-1.4.2.js"></script><script type="text/javascript" src="js/jquery.galleriffic.js"></script><script type="text/javascript" src="js/jquery.opacityrollover.js"></script><script type="text/javascript" src="js/function.js"></script>
?
?
需要显示的页面
<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8" isELIgnored="false" %><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>相册展示</title><link rel="stylesheet" href="css/basic.css" type="text/css" /><link rel="stylesheet" href="css/galleriffic-3.css" type="text/css" /><script type="text/javascript" src="js/jquery-1.4.2.js"></script><script type="text/javascript" src="js/jquery.galleriffic.js"></script><script type="text/javascript" src="js/jquery.opacityrollover.js"></script><script type="text/javascript" src="js/function.js"></script></head><body><div id="page"><div id="container"><h1>安全检查相册</h1><h2>0905</h2><!-- Start Advanced Gallery Html Containers --><div id="gallery" var="img"><li><a name="leaf" href="uploadImages/${img}" title="图片"><img width="100" height="80" src="uploadImages/${img}" alt="相本展示" /></a></li></c:forEach></ul></div><!-- End Advanced Gallery Html Containers --><div style="clear: both;"></div></div></div></body></html>
?
?
?初始化插件
jQuery(document).ready(function($) {// We only want these styles applied when javascript is enabled$('div.navigation').css({'width' : '300px','float':'left'});//导航宽度$('div.content').css('display', 'block');//内容样式为显示// Initially set opacity on thumbs and add// additional styling for hover effect on thumbsvar onMouseOutOpacity = 0.67;//朦胧系数$('#thumbs ul.thumbs li').opacityrollover({mouseOutOpacity: onMouseOutOpacity,mouseOverOpacity: 1.0,fadeSpeed: 'fast',//快速显示exemptionSelector: '.selected'//选中的图片});// Initialize Advanced Galleriffic Galleryvar gallery = $('#thumbs').galleriffic({delay: 2500,//幻灯延时numThumbs: 10,//分页数量preloadAhead: 5,//预加载图片的数量enableTopPager: true,//顶部分页链接enableBottomPager: true,//底部分页链接//maxPagesToShow: 7,//显示图片的位置与样式imageContainerSel: '#slideshow',controlsContainerSel: '#controls',captionContainerSel: '#caption',loadingContainerSel: '#loading',renderSSControls: true,//是否开始幻灯片播放renderNavControls: true,//右上角的上下页playLinkText: '幻灯片播放',pauseLinkText: '暂停幻灯片播放',prevLinkText: '‹ 上一张图片',nextLinkText: '下一张图片 ›',nextPageLinkText: '下一页 ›',prevPageLinkText: '‹ 上一页',//enableHistory: true,//是否启用历史记录autoStart: false,//幻灯片是否自动开始syncTransitions: true,//同步defaultTransitionDuration: 900,//右边显示图片的淡入淡出的时间//幻灯片切换的效果onSlideChange: function(prevIndex, nextIndex) {// 'this' refers to the gallery, which is an extension of $('#thumbs')this.find('ul.thumbs').children().eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end().eq(nextIndex).fadeTo('fast', 1.0);}});});
?
?