0

0

jQuery实现旋转幻灯片轮播效果(附代码)

php中世界最好的语言

php中世界最好的语言

发布时间:2018-04-24 10:16:50

|

2607人浏览过

|

来源于php中文网

原创

这次给大家带来jQuery实现旋转幻灯片轮播效果(附代码),jQuery实现旋转幻灯片轮播效果的注意事项有哪些,下面就是实战案例,一起来看一下。

特点

  • 响应式——适应任何视窗的宽度

  • 混合内容

  • 不需要CSS

  • 轻量级(

  • 基于jQuery构建

  • 集成图像预加载

  • 回调函数——onConstruct onStart,onEnd

  • 多个可配置选项

  • 延迟加载图片

  • 自动旋转

  • 容易扩展

jquery实例:anoSlide使用方法

引入核心文件


写入基础CSS样式,可根据项目完全自定义

.carousel {
  position: relative;
  min-height: 20px;
  height: auto !important;
  height: 20px;
  background: url(images/loader.gif) center center no-repeat;
}
.carousel .next, .carousel .prev {
  display: none;
  width: 56px;
  height: 56px;
  position: absolute;
  bottom: 20px;
  left: 50%;
  margin-top: -28px;
  z-index: 9999;
  cursor: pointer;
}
.carousel .prev {
  margin-left: -60px;
  background: url(images/prev.png) 0 0 no-repeat;
}
.carousel .next {
  margin-right: -60px;
  background: url(images/next.png) 0 0 no-repeat;
}
.carousel li {
  display: none;
}
.carousel li img {
  width: 100%;
  height: auto;
}
.paging {
  position: absolute;
  z-index: 9998;
}
.paging > a {
  display: block;
  cursor: pointer;
  width: 40px;
  height: 40px;
  float: left;
  background: url(images/dots.png) 0px -40px no-repeat;
}
.paging > a:hover, .paging > a.current {
  background: url(images/dots.png) 0px 0px no-repeat;
}
.badge {
  display: block;
  width: 104px;
  height: 104px;
  background: url(images/badge.png) 0 0 no-repeat;
  z-index: 9000;
  position: absolute;
  top: -3px;
  left: -3px;
}
img {
  -webkit-user-select: none; /* Chrome all / Safari all */
  -moz-user-select: none;   /* Firefox all */
  -ms-user-select: none;   /* IE 10+ */
  -o-user-select: none;
  user-select: none;
}

jquery旋转木马anoSlide混合显示

JS

$('.carousel ul').anoSlide(
{
  items: 1,
  speed: 500,
  prev: 'a.prev',
  next: 'a.next',
  lazy: true,
  auto: 4000
})
html
  • Content goes here
  • Content goes here
  • Content goes here

jquery幻灯片anoSlide多图

JS

$('.carousel[data-mixed] ul').anoSlide(
{
  items: 5,
  speed: 500,
  prev: 'a.prev[data-prev]',
  next: 'a.next[data-next]',
  lazy: true,
  delay: 100})

HTML

  • @@##@@

  • @@##@@

  • @@##@@

  • @@##@@

  • @@##@@

  • @@##@@

  • @@##@@

jquery旋转木马anoSlide分页

jQuery实现旋转幻灯片轮播效果(附代码)

js

$('.carousel ul').anoSlide(
{
  items: 1,
  speed: 500,
  prev: 'a.prev[data-prev-paging]',
  next: 'a.next[data-next-paging]',
  lazy: true,
  onConstruct: function(instance)
  {
    var paging = $('

').addClass('paging fix').css( { position: 'absolute', top: 1, left:50 + '%', width: instance.slides.length * 40, marginLeft: -(instance.slides.length * 40)/2 }) /* Build paging */ for (i = 0, l = instance.slides.length; i < l; i++) { var a = $('').data('index', i).appendTo(paging).on( { click: function() { instance.stop().go($(this).data('index')); } }); if (i == instance.current) { a.addClass('current'); } } instance.element.parent().append(paging); }, onStart: function(ui) { var paging = $('.paging'); paging.find('a').eq(ui.instance.current).addClass('current').siblings().removeClass('current'); } })

html

  • Content goes here
  • Content goes here
  • Content goes here

jquery幻灯片anoSlide标题

jQuery实现旋转幻灯片轮播效果(附代码)

js

$('.carousel.captions ul').anoSlide(
{
  items: 1,
  speed: 500,
  prev: 'a.prev[data-prev-caption]',
  next: 'a.next[data-next-caption]',
  lazy: true,
  onStart: function(ui)
  {
    /* Remove existing caption in slide */
    ui.slide.element.find('.caption').remove();
  },
  onEnd: function(ui)
  {
    /* Get caption content */
    var content = ui.slide.element.data('caption');
     
    /* Create a caption wrap element */
    var caption = $('

').addClass('caption').css( { position: 'absolute', background: 'rgb(0,0,0)', color: 'rgb(255,255,255)', textShadow: 'rgb(0,0,0) -1px -1px', opacity: 0.5, top: -100, left: 50, padding: 20, webkitBorderRadius: 5, mozBorderRadius: 5, borderRadius: 5 }).html(content); /* Append caption to slide and animate it. Animation is really up to you. */ caption.appendTo(ui.slide.element).animate( { top:50 }); } })

html

  • @@##@@
  • @@##@@
  • @@##@@
  • @@##@@
  • @@##@@
  • @@##@@
  • @@##@@

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

推荐阅读:

jQuery图片轮播旋转切换效果代码
jQuery图片轮播旋转切换效果代码

jQuery图片轮播旋转切换效果代码基于jquery-1.7.2.min.js制作,点击左右箭头,切换图片显示,鼠标离开时自动播放,代码有详细中文注释,方便修改。

下载

 jQuery+PHP实现编辑表格并保存方法

jquery实现表格本地排序步骤详解(附代码)

jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)jQuery实现旋转幻灯片轮播效果(附代码)

相关专题

更多
PS使用蒙版相关教程
PS使用蒙版相关教程

本专题整合了ps使用蒙版相关教程,阅读专题下面的文章了解更多详细内容。

23

2026.01.19

java用途介绍
java用途介绍

本专题整合了java用途功能相关介绍,阅读专题下面的文章了解更多详细内容。

11

2026.01.19

java输出数组相关教程
java输出数组相关教程

本专题整合了java输出数组相关教程,阅读专题下面的文章了解更多详细内容。

3

2026.01.19

java接口相关教程
java接口相关教程

本专题整合了java接口相关内容,阅读专题下面的文章了解更多详细内容。

2

2026.01.19

xml格式相关教程
xml格式相关教程

本专题整合了xml格式相关教程汇总,阅读专题下面的文章了解更多详细内容。

4

2026.01.19

PHP WebSocket 实时通信开发
PHP WebSocket 实时通信开发

本专题系统讲解 PHP 在实时通信与长连接场景中的应用实践,涵盖 WebSocket 协议原理、服务端连接管理、消息推送机制、心跳检测、断线重连以及与前端的实时交互实现。通过聊天系统、实时通知等案例,帮助开发者掌握 使用 PHP 构建实时通信与推送服务的完整开发流程,适用于即时消息与高互动性应用场景。

13

2026.01.19

微信聊天记录删除恢复导出教程汇总
微信聊天记录删除恢复导出教程汇总

本专题整合了微信聊天记录相关教程大全,阅读专题下面的文章了解更多详细内容。

93

2026.01.18

高德地图升级方法汇总
高德地图升级方法汇总

本专题整合了高德地图升级相关教程,阅读专题下面的文章了解更多详细内容。

112

2026.01.16

全民K歌得高分教程大全
全民K歌得高分教程大全

本专题整合了全民K歌得高分技巧汇总,阅读专题下面的文章了解更多详细内容。

155

2026.01.16

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
jQuery 教程
jQuery 教程

共42课时 | 4.4万人学习

HTML+CSS基础与实战
HTML+CSS基础与实战

共132课时 | 9.6万人学习

tp6+adminlte搭建通用后台
tp6+adminlte搭建通用后台

共39课时 | 5.8万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号