- 浏览: 125370 次
- 性别:
- 来自: 成都
-
文章分类
最新评论
-
煎蛋就是幸福:
...
试读《跨终端Web》 -
xiaoshitoushifa:
最好把demo贴上啊!发一份到435065893@qq.com ...
漂亮的系统后台UI 欣赏 -
xiaoshitoushifa:
只有图片 没有demo 啊
漂亮的系统后台UI 欣赏
jCarousel
Riding carousels with jQuery
Author: Jan Sorgalla
Version: 0.2.3 (Changelog)
Download: jcarousel.tar.gz or jcarousel.zip
Licence: Dual licensed under the MIT and GPL licenses.Introduction
- Carousel with dynamic content loading via JavaScript
- Carousel with dynamic content loading via Ajax
- Carousel with dynamic content loading via Ajax from a PHP script
- Carousel with dynamic content loading via Ajax from the Flickr photo stream
- Carousel with dynamic content loading via Ajax from the Flickr API
- Circular carousel
- Using jCarousel as a Textscroller
- Flexible carousel
- jCarousel and Thickbox 3
- Carousel with custom animation effect
<head>
tag of your HTML document:
<script type="text/javascript" src="/path/to/jquery-1.2.1.pack.js"></script><script type="text/javascript" src="/path/to/lib/jquery.jcarousel.pack.js"></script><link rel="stylesheet" type="text/css" href="/path/to/lib/jquery.jcarousel.css" /><link rel="stylesheet" type="text/css" href="/path/to/skin/skin.css" />
The download package contains some example skin packages. Feel free to build your own skins based on it.
jCarousel expects a very basic HTML markup structure inside your HTML document:
<ul id="mycarousel" class="jcarousel-skin-name"> <!-- The content goes in here --></ul>
jCarousel automatically wraps the required HTML markup around the list. The class attribute applies the jCarousel skin "name" to the carousel.
To setup jCarousel, add the following code inside the
<head>
tag of your HTML document:
<script type="text/javascript">jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ // Configuration goes here });});</script>
jCarousel accepts a lot of configuration options, see chapter "Configuration" for further informations.
After jCarousel has been initialised, the fully created markup in the DOM is:
<div class="jcarousel-skin-name"> <div class="jcarousel-container"> <div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div> <div class="jcarousel-next"></div> <div class="jcarousel-clip"> <ul class="jcarousel-list"> <li class="jcarousel-item-1">First item</li> <li class="jcarousel-item-2">Second item</li> </ul> </div> </div></div>
As you can see, there are some elements added which have assigned classes (in addition to the classes you may have already assigned manually). Feel free to design your carousel with the classes you can see above.
Note:
- The skin class "jcarousel-skin-name" has been moved from the
<ul>
to the top
<div>
element.
- The first nested
<div>
under
<div class="jcarousel-container">
illustrates a disabled button, the second an enabled one. The disabled button has the attribute
disabled
(which actually makes no sense for
<div>
elements, but you can also use
<button>
elements or whatever you want) as well as the additional class
jcarousel-prev-disabled
(or
jcarousel-next-disabled
).
- All
<li>
elements of the list have the class
jcarousel-item-n
assigned where
n
represents the position in the list.
- Not shown here is, that all classes are followed by additional classes with a suffix dependent on the orientation of the carousel, ie.
<ul class="jcarousel-list jcarousel-list-horizontal">
for a horizontal carousel.
0
(default) then autoscrolling is turned off.
"first"
,
"last"
or
"both"
as string. If set to
null
, wrapping is turned off (default). You can also pass
"circular"
as option to enable support for circular carousels. See the example Circular carousel on how to implement it.
itemLoadCallback: { onBeforeAnimation: callback1, onAfterAnimation: callback2}
<li>
object itself, the index which indicates the position of the item in the list and the state of the carousel action (prev, next or init). Alternatively, you can pass a hash of one or two functions which are triggered before and/or after animation:
itemFirstInCallback: { onBeforeAnimation: callback1, onAfterAnimation: callback2}
<li>
object itself, the index which indicates the position of the item in the list and the state of the carousel action (prev, next or init). Alternatively, you can pass a hash of one or two functions which are triggered before and/or after animation:
itemFirstOutCallback: { onBeforeAnimation: callback1, onAfterAnimation: callback2}
<li>
object itself, the index which indicates the position of the item in the list and the state of the carousel action (prev, next or init). Alternatively, you can pass a hash of one or two functions which are triggered before and/or after animation:
itemLastInCallback: { onBeforeAnimation: callback1, onAfterAnimation: callback2}
<li>
object itself, the index which indicates the position of the item in the list and the state of the carousel action (prev, next or init). Alternatively, you can pass a hash of one or two functions which are triggered before and/or after animation:
itemLastOutCallback: { onBeforeAnimation: callback1, onAfterAnimation: callback2}
<li>
object itself, the index which indicates the position of the item in the list and the state of the carousel action (prev, next or init). Alternatively, you can pass a hash of one or two functions which are triggered before and/or after animation:
itemVisibleInCallback: { onBeforeAnimation: callback1, onAfterAnimation: callback2}
<li>
object itself, the index which indicates the position of the item in the list and the state of the carousel action (prev, next or init). Alternatively, you can pass a hash of one or two functions which are triggered before and/or after animation:
itemVisibleOutCallback: { onBeforeAnimation: callback1, onAfterAnimation: callback2}
<div></div>
null
, no next-button is created.
<div></div>
null
, no prev-button is created.
jCarousel is inspired by the Carousel Component written by Bill Scott.
发表评论
-
用jquery开发幻灯片播放功能(完整版)
2014-04-10 12:08 972很久没有写了,今天写一个简单的效果,幻灯片无限滚动和大家一起 ... -
jStepper
2012-09-19 15:18 727http://jstepper.emkay.dk/Defaul ... -
swfobject
2012-03-05 19:28 922SWFObject: 基于Javascript的F ... -
jquery插件开发
2012-02-24 14:42 1542jquery插件开发方式多样化。 个人比较喜欢以下方式: ... -
LightBox -灯箱效果插件(非常漂亮)
2011-11-01 08:48 914Lightbox,也就是灯箱特效 1) ... -
Notify - 消息通知插件
2011-10-31 14:19 1146Notify - 消息通知插件 1) Stick ... -
Draggable - 拖放插件
2011-10-31 14:15 11361) SpryMap一个超级轻量级的依赖于 JavaSc ... -
jQuery Tooltips插件
2011-10-31 14:04 690分享几个Tooltips插件 1) Pos ... -
一个通用的框架
2011-04-22 07:26 747一个通用的框架 一个通用的框架 在动手写自己的jQuery插件 ... -
使用 jQuery(中级),第 2 部分: 创建自己的插件
2011-04-21 21:08 936简介 在该系列之前的文章 使用 jQuery,第 2 部分: ... -
jquery的extend和fn.extend的使用说明
2011-04-21 10:20 774jQuery.fn.extend(object); 对jQue ...
相关推荐
在构建电子商务网站时...总的来说,jcarousel+jqzoom 的组合是电商网站中提升图片展示效果的有效工具,通过熟练掌握这两个插件的使用,开发者可以创造出更加吸引用户的商品展示区,从而提升网站的用户体验和商业价值。
jQuery的许多插件如jCarousel或Slick可以帮助开发者轻松创建这种效果,支持触摸滑动,自动播放,多方向滑动等功能。通过CSS3的transform属性和transition属性,可以实现平滑的过渡效果。 “导航级联”是网页导航...
Image Switch插件专门用于切换图片,它可以用于创建一个平滑的图片滚动效果,让用户在浏览网页时有一种视觉上的享受。 10. jCarousel插件 jCarousel插件允许你将一个标准的JavaScript数组转换成一个可滚动的图片或...
9. **插件使用**: JQuery社区提供了大量预封装的插件,如`jCarousel`、` owl.carousel `等用于实现高级的轮播效果。压缩包中可能包含这些插件的定制版本,以适应特定的广告需求。 10. **性能优化**: 使用JQuery时,...
1.3版本的jQuery伴随着丰富的插件生态系统,如用于图片懒加载的Lazy Load,表单验证的validate,以及幻灯片展示的jCarousel等,极大地扩展了jQuery的功能边界。 8. **兼容性** jQuery1.3致力于跨浏览器兼容性,...