JQuery开发之Galleriffic图片插件介绍
来源:互联网 发布:英雄联盟mac下载安装 编辑:程序博客网 时间:2024/05/29 19:14
1. 下载最新版本的Galleriffic与jQuery。jQuery在1.3.2以上。
2. 在目标HTML代码中引入jQuery库与Galleriffic插件。两者的实现方式均为javascript。
<head>
...
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="js/jquery.galleriffic.js"></script>
<!-- Optionally include jquery.history.js for history support -->
<script type="text/javascript" src="js/jquery.history.js"></script>
<script type="text/javascript" src="js/jquery.opacityrollover.js"></script>
...
</head>
3. 添加容器元素Div。值得注意的是,这里所有的Div都是可选的。用户可以根据自己的实际情况做出取舍。
<div id="controls"></div>
<div id="loading"></div>
<div id="slideshow"></div>
<div id="caption"></div>
<div id="thumbs">
... 这里用来放图片清单…(见步骤4)
</div>
4. 建立图片清单列表
<div id="thumbs">
<ul class="thumbs noscript">
<li>
<a class="thumb" name="optionalCustomIdentifier" href="path/to/slide" title="your image title">
<img src="path/to/thumbnail" alt="your image title again for graceful degradation" />
</a>
<div class="caption">
(这里用来放标题、描述等信息)
</div>
</li>
... (接下的就是类似上面的li代码,一个li元素包含一张图片)
</ul>
</div>
5. 初始化插件
var gallery = $('#gallery').galleriffic('#thumbs', {
delay: 3000 // 动画播放间隔时间
numThumbs: 20 // 所要显示的图片数目
preloadAhead: 40 // 设置为-1时预加载所有图片
enableTopPager: false,
enableBottomPager: true,
imageContainerSel: '', // 接下来的三个属性是作为容器的css名
controlsContainerSel: '', // The CSS selector for the element within which the slideshow controls should be rendered
captionContainerSel: '', // The CSS selector for the element within which the captions should be rendered
loadingContainerSel: '', // The CSS selector for the element within which should be shown when an image is loading
renderSSControls: true, // 是否显示播放与暂停按钮
renderNavControls: true, // 是否显示前进后退按钮
playLinkText: 'Play',
pauseLinkText: 'Pause',
prevLinkText: 'Previous',
nextLinkText: 'Next',
nextPageLinkText: 'Next ›',
prevPageLinkText: '‹ Prev',
enableHistory: false, // Specifies whether the url's hash and the browser's history cache should update when the current slideshow image changes
autoStart: false, // 是否自动播放
onChange: undefined, // 接下来是插件的回调函数
onTransitionOut: undefined, // accepts a delegate like such: function(callback) { ... }
onTransitionIn: undefined, // accepts a delegate like such: function() { ... }
onPageTransitionOut: undefined, // accepts a delegate like such: function(callback) { ... }
onPageTransitionIn: undefined // accepts a delegate like such: function() { ... }
});
- JQuery开发之Galleriffic图片插件介绍
- JQuery开发之Galleriffic图片插件介绍
- jquery.galleriffic.js api
- Jquery插件开发之图片放大镜效果(仿淘宝)
- jQuery之插件开发
- jQuery图片滚动十佳插件重点介绍
- 10+个jQuery图片滚动插件介绍
- JavaScript图片浏览器——Galleriffic
- jQuery学习之插件开发
- jQuery之插件开发入门
- jQuery插件开发(一)基础介绍
- jQuery之插件开发--jQuery.fn.extend()
- jquery插件合集之图片裁剪
- loner_li JQuery 插件之 放大镜图片效果
- jquery插件之拖拽删除图片
- jquery插件合集之图片裁剪
- 原创jQuery插件之图片自适应
- jQuery插件之lightBox图片灯箱
- 出现No enclosing instance of type Exp is accessible. Must qualify the allocation with an enclosing ins
- Android4.4深入浅出之SurfaceFlinger总体结构
- 第四周项目3—2.单链表的应用(单链表的递增)
- 使用js原型实现石头剪刀布猜拳
- 第四周项目3(1)-结点逆置
- JQuery开发之Galleriffic图片插件介绍
- 第四周项目一用星号拼字母
- Spring单例与线程安全小结
- PHP 源码加密 (zendGuard和ionCube)
- apache主机重写规则与nginx主机重写规则转换
- 大数据Hadoop核心架构HDFS+MapReduce+Hbase+Hive内部机理详解
- 自定义浏览器协议,实现web程序调用本地程序
- Swift-iOS常用控件(UIActivityIndicatorView 活动指示器)
- 时间相关API实战1