jQuery做出响应式图片轮播效果

这次给大家带来jQuery做出响应式图片轮播效果,jQuery做出响应式图片轮播效果的注意事项有哪些,下面就是实战案例,一起来看一下。

运行效果截图如下:

jQuery做出响应式图片轮播效果

mislider是一款效果非常酷的jQuery响应式圆形图片轮播图特效插件,mislider轮播图插件的特点有:

使用简单

在同一个屏幕中支持多个轮播图

轮播图的内容可以是单张图片或复杂的HTML内容

轻量级

响应式设计

非常容易定制

丰富的回调函数

跨浏览器,支持IE8+浏览器

引入核心文件
mislider插依赖于一些插件,在引入之前要先引入jQuery、html5shiv.js、mislider.min.js以及mislider.min.css,mislider-custom.css文件


登录后复制

构建html

  1. Pink Water Lillies
    Pink Water Lillies
  2. Pond with Lillies
    Pond with Lillies

登录后复制

注意:上面的class并不是必须的,如果不写这些class,插件会自动为相应的元素添加class。默认情况下,该轮播图插件使用的是有序列表的结构,如果你使用不同的元素结构,请确保要修改selectorSlider和selectorSlide选项。

写入JS初始化插件

jQuery(function ($) {   var slider = $('.mis-stage').miSlider({    // The height of the stage in px. Options: false or positive integer. false = height is calculated using maximum slide heights. Default: false    stageHeight: 380,    // Number of slides visible at one time. Options: false or positive integer. false = Fit as many as possible. Default: 1    slidesOnStage: false,    // The location of the current slide on the stage. Options: 'left', 'right', 'center'. Defualt: 'left'    slidePosition: 'center',    // The slide to start on. Options: 'beg', 'mid', 'end' or slide number starting at 1 - '1','2','3', etc. Defualt: 'beg'    slideStart: 'mid',    // The relative percentage scaling factor of the current slide - other slides are scaled down. Options: positive number 100 or higher. 100 = No scaling. Defualt: 100    slideScaling: 150,    // The vertical offset of the slide center as a percentage of slide height. Options: positive or negative number. Neg value = up. Pos value = down. 0 = No offset. Default: 0    offsetV: -5,    // Center slide contents vertically - Boolean. Default: false    centerV: true,    // Opacity of the prev and next button navigation when not transitioning. Options: Number between 0 and 1. 0 (transparent) - 1 (opaque). Default: .5    navButtonsOpacity: 1   });  });

登录后复制

注意:要确保.mis-stage jQuery选择器和HTML页面中的轮播图容器的class名称相同。
参数

 jQuery(function ($) {   var slider = $('.mis-stage').miSlider({    // 轮播图过渡动画的速度     // 单位毫秒. Options: positive integer.    speed: 700,    // 轮播图在两个过渡动画之间的暂停时间     // in milliseconds. Options: false, positive integer.     // false = Autoplay off,设为false则不自动播放.    pause: 4000,    // 轮播图的增量     // Autoplay and Nav Buttons. 自动播放与导航按钮     // Options: positive or negative integer.     // Positive integer = Slide left. 正数向左    // Negative integer = Slide right. 负数向右    increment: 1,    // 轮播图的高度     // Options: false or positive integer. 值:false或正整数    // false = height is calculated using 设为false自动计算高度    // maximum slide heights.最大高度    stageHeight: false,    // 同时在屏幕上可见的轮播图图片数量    // Options: false or positive integer. 值:false或正整数    // false = Fit as many as possible. false为自适应    slidesOnStage: 1,    // 连续运动-轮播图在同一个方向上无限循环     // true = slides loop in one direction if possible.    slidesContinuous: true,    // 当前轮播图在屏幕上的位置:left, center, right     // Options: 'left', 'right', 'center'.    slidePosition: 'left',    // 轮播图开始播放的位置.     // Options: 'beg', 'mid', 'end'     // or slide number starting at 1 - '1','2', etc.    slideStart: 'beg',    // 当前slide的宽度,单位px     // Options: false or positive integer. 值:false或正整数    // false = width is the maximum of 设为false时为最大宽度    // the existing slide widths.    slideWidth: false,    // 当前slide的缩放因子-其它图片会相应缩小    // of the current slide    // other slides are scaled down.     // Options: positive number 100 or higher.     // 100 = No scaling.    slideScaling: 100,    // slide的垂直偏移    // as a percentage of slide height.     // Options: positive or negative number.     // Neg value = up. Pos value = down.     // 0 = No offset.    offsetV: 0,    // slide中的内容垂直居中    // Boolean.    centerV: false,    // 原点导航按钮是否可用    // Boolean.    navList: true,    // 箭头导航按钮是否可用    // Boolean.    navButtons: true,    // 箭头导航一直显示    // except when transitioning - Boolean.    navButtonsShow: false,    // 箭头导航按钮的透明度     // button navigation when not transitioning.     // Options: Number between 0 and 1.     // 0 (transparent) - 1 (opaque).    navButtonsOpacity: 0.5,    // 轮播图随机顺序    // Boolean.    randomize: false,    // 轮播图加载后的回调函数    // called when slides have loaded.    slidesLoaded: false,    // 轮播图过渡动画前的回调函数    // call back function - called before     // the slide transition.    beforeTrans: false,    // 轮播图过渡动画完成之后的回调函数    // call back function - called at the end     // of a slide transition.    afterTrans: false,    // Stage元素上的class名称    // to the stage element.    classStage: 'mis-stage',    // The CSS class that will be Slider元素上的class名称    // applied to the slider element.    classSlider: 'mis-slider',    // The CSS class that will be 每一个Slide元素上的class名称    // applied to each slide element.    classSlide: 'mis-slide',    // The CSS class that will be 箭头导航按钮元素上的class名称    // applied to the parent of the     // prev and next button navigation elements.    classNavButtons: 'mis-nav-buttons',    // The CSS class that will be 圆点导航按钮上的class名称    // applied to the parent of the     // numbered list navigation elements    classNavList: 'mis-nav-list',    // The selector used to select 用于选择轮播图的选择器    // the slider element    // Descendant of the stage    selectorSlider: 'ol',    // The selector used to select 用于选择每一个Slide的选择器    // each slide element    // Descendant of the slider    selectorSlide: 'li'   });  });

登录后复制

相信看了本文案例你已经掌握了方法,更多精彩请关注【创想鸟】其它相关文章!

推荐阅读:

JS+JQuery动态操作表格行方法详解

jQuery实现表单里文字按钮特效合集

以上就是jQuery做出响应式图片轮播效果的详细内容,更多请关注【创想鸟】其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2768249.html

(0)
上一篇 2025年3月8日 11:58:23
下一篇 2025年2月28日 20:18:17

AD推荐 黄金广告位招租... 更多推荐

相关推荐

  • jquery点击缩略图切换播放效果实现

    这次给大家带来jquery点击缩略图切换播放效果实现,jquery点击缩略图切换播放的注意事项有哪些,下面就是实战案例,一起来看一下。 jquery点击缩略图切换视频播放是一款非常实用的播放代码,点击视频缩略图切换优酷视频播放的视频播放选项…

    2025年3月8日 编程技术
    200
  • JQuery实现侧边栏菜单

    这次给大家带来JQuery实现侧边栏菜单,JQuery实现侧边栏菜单的注意事项有哪些,下面就是实战案例,一起来看一下。 效果图如下:   在线预览    源码下载 html代码: Home About Us Our Work Contact…

    2025年3月8日
    200
  • jQuery插件seat-charts使用详解(附代码)

    这次给大家带来jQuery插件seat-charts使用详解(附代码),jQuery插件seat-charts使用详解的注意事项有哪些,下面就是实战案例,一起来看一下。 这是一款基于JQuery实现的在线选座位插件seat-charts源码…

    2025年3月8日
    200
  • Jquery解析Json字符串与Json数组方法详解

    这次给大家带来Jquery解析Json字符串与Json数组方法详解,Jquery解析Json字符串与Json数组的注意事项有哪些,下面就是实战案例,一起来看一下。 解析json字符串、json数组 {“ret”: 0, “msg”: “”,…

    编程技术 2025年3月8日
    200
  • jQuery操作json方法总结

    这次给大家带来jQuery操作json方法总结,jQuery操作json的注意事项有哪些,下面就是实战案例,一起来看一下。 在项目中经常会用到获取json中的某个值,或者动态的创建一个json对象,今天简单的做了一个通用的js /** * …

    编程技术 2025年3月8日
    200
  • jquery对Json遍历步骤详解

    这次给大家带来jquery对Json遍历步骤详解,jquery对Json遍历的注意事项有哪些,下面就是实战案例,一起来看一下。 概述 JSON(javascript Object Notation) 是一种轻量级的数据交换格式,采用完全独立…

    编程技术 2025年3月8日
    200
  • Jquery跨域获得Json方式方法

    这次给大家带来Jquery跨域获得Json方式方法,Jquery跨域获得Json的注意事项有哪些,下面就是实战案例,一起来看一下。 这两天用 Jquery 跨域取数据的时候,经常碰到 invalid label 这个错误,十分的郁闷,老是取…

    编程技术 2025年3月8日
    200
  • jQuery有哪些方法终止ajax请求

    这次给大家带来jQuery有哪些方法终止ajax请求,jQuery终止ajax请求的注意事项有哪些,下面就是实战案例,一起来看一下。 jQuery实现ajax的叠加和停止的关键代码如下所示: jQuery中终止Ajax请求 var arra…

    编程技术 2025年3月8日
    200
  • jQuery怎样向服务器发出get和post请求

    这次给大家带来jQuery怎样向服务器发出get和post请求,jQuery向服务器发出get和post请求的注意事项有哪些,下面就是实战案例,一起来看一下。 假设有个网站A,它有一个简单的输入用户名的页面,界面上有两个输入框,第一个输入框…

    2025年3月8日
    200
  • jQuery实现异步刷新

    这次给大家带来jQuery实现异步刷新,jQuery实现异步刷新的注意事项有哪些,下面就是实战案例,一起来看一下。 最近要用到jquery进行异步读取数据的功能,jquery提供了许多内置的异步读取函数,给大家演示下最常用的$.ajax用法…

    2025年3月8日
    200

发表回复

登录后才能评论