幻灯片/轮播

jQuery+CSS3炫酷图片3D旋转幻灯片特效

阿里云


iPresenter 是一款效果非常炫酷的 jQuery 和 CSS3 3D 旋转幻灯片特效插件。你可以使用它来制作产品展示、图片画廊或者各种幻灯片和轮播图特效。这款幻灯片插件的特点有:

兼容 jQuery

也想出现在这里?联系我们
创客主机

高度灵活和可定制性

灵活的用户界面的设计

在单个 HTML 页面中允许存在多个实例

可以定制每一个 slider 的 easing 效果

多语言支持

可以在 iOS 和 Android 上正常工作

可以选择自动播放模式下鼠标悬停时停止播放幻灯片

非常容易调整尺寸

兼容外部字体(如谷歌字体)

有预加载进度条显示

支持键盘控制

支持移动触摸屏

可以通过 CSS 来自定义样式

使用配置简单易用

不限制 transition 效果

可定制 transition 配置和 transition timing 函数(easing)

可以使用 Cubic-bezier 函数

可定制每一个幻灯片的时间

带 tooltip 缩略图显示

可以通过缩略图或圆点导航按钮来导航

可以在所有支持 CSS3 的现代浏览器中工作

HTML 结构:

该幻灯片的 HTML 结构可以使用一个简单的 HTML5 结构:

  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>iPresenter</title>
  5.  
  6.  
  7.         <!-- Google Webfonts and our stylesheet -->
  8.         <link rel="stylesheet" href="http://fonts.useso.com/css?family=PT+Sans+Narrow" />
  9.         <link rel="stylesheet" href="css/styles.css" />
  10.         <link rel="stylesheet" href="css/demo1.css" />
  11.  
  12.         <!-- JavaScript includes -->
  13.         <script src="js/jquery-1.7.1.min.js"></script>
  14.         <script src="js/ipresenter.encoded.js"></script>
  15.  
  16.         <!-- iPresenter script starter Section -->
  17.         <script>
  18.             $(document).ready(function(){
  19.                 $('#ipresenter').iPresenter();
  20.             });
  21.         </script>
  22.     </head>
  23.     <body>
  24.  
  25.         <!-- BEGIN CONTAINER -->
  26.         <div class="container">
  27.  
  28.             <!-- BEGIN #ipresenter element container -->
  29.             <div id="ipresenter">
  30.  
  31.                 <!-- The Slides Will Go Here -->
  32.  
  33.             </div>
  34.             <!-- END #ipresenter element container -->
  35.  
  36.         </div>
  37.         <!-- END CONTAINER -->
  38.  
  39.     </body>
  40. </html>

div#ipresenter 用于包裹整个幻灯片。

  1. <div id="ipresenter">
  2.  
  3.     <!-- The Slides Will Go Here -->
  4.  
  5. </div>

通过这个幻灯片插件,我们可以创建各种幻灯片切换时的平滑过渡效果。插件通过为每一个 div 设置不同的 data 属性,这些 data 属性会转换为真正的 CSS3 动画效果。下面是所有可用的 data 属性:

data-easing:easing timing 函数(也可接收 cubic-bezier 函数)。

  1.  
  2.         linear
  3.         ease
  4.         ease-in
  5.         ease-out
  6.         ease-in-out
  7.         ease-out-in
  8.         easeInQuad
  9.         easeOutQuad
  10.         easeInOutQuad
  11.         easeInCubic
  12.         easeOutCubic
  13.         easeInOutCubic
  14.         easeInQuart
  15.         easeOutQuart
  16.         easeInOutQuart
  17.         easeInQuint
  18.         easeOutQuint
  19.         easeInOutQuint
  20.         easeInSine
  21.         easeOutSine
  22.         easeInOutSine
  23.         easeInExpo
  24.         easeOutExpo
  25.         easeInOutExpo
  26.         easeInCirc
  27.         easeOutCirc
  28.         easeInOutCirc
  29.         easeInBack
  30.         easeOutBack
  31.         easeInOutBack

data-pausetime:slide 多久才会显示

data-x, data-y, data-z:将幻灯片在屏幕 3D 空间中移动

data-rotate, data-rotate-x, data-rotate-y, data-rotate-z:沿指定的轴旋转元素,单位 degrees

data-scale:放大或缩小幻灯片

data-thumbnail:缩略图的 url

代码如下:

  1. <!-- The first slide retains its default position. We could omit the data attributes -->
  2. <div id="intro" class="step" data-x="0" data-y="0">
  3.     <img src="img/details.png" />
  4.     <h2>A phone that sees the world like you do, in 3D</h2>
  5.     <p>Now your photos can have as much depth as the moment itself. HTC EVO 3D captures your photos and videos in 3D, plus you can view them without the glasses. The stunning 4.3-inch qHD display gives you crisp websites, vivid images and incredibly fluid videos.</p>
  6. </div>
  7.  
  8. <!-- We are offsetting the second slide, rotating it and making it 1.8 times larger -->
  9. <div id="capture" class="step" data-x="1100" data-y="1200" data-scale="1.8" data-rotate="180" data-easing="easeInOutQuint">
  10.     <img src="img/ksp1.png" />
  11.     <h2>Capture life in 3D</h2>
  12.     <p>HTC EVO 3D allows you to shoot 3D movies and snap 3D photos via dual cameras, so no matter where you are, capture life as it should be. And see it all in true-to-life detail without 3D glasses.</p>
  13. </div>
  14.  
  15. <!-- Same for the rest.. -->
  16. <div id="view" class="step" data-x="-300" data-y="600" data-scale="0.2" data-rotate="270">
  17.     <img src="img/ksp2.png" />
  18.     <h2>An incredible view</h2>
  19.     <p>The large 4.3 inch display serves up incredibly crisp websites, vivid images and fluid video on a pixel-packed qHD screen. Catch the latest blockbusters straight from HTC Watch � a new service that starts the show just seconds into the download and monitors your Internet connection to ensure uninterrupted viewing.</p>
  20. </div>

CSS 样式:

该幻灯片插件中有两个主要的 CSS 样式文件,一个是 styles.css,这个样式表用于生成页面的通用样式,如字体、链接等样式。第二个对应每个 demo 的样式表,分为 demo1.css 和 demo2.css,分别用于为两个 demo 指定样式:

  1. /* === Preloader Section === */
  2.  
  3.     div#ipresenter div#preloader {
  4.         some styles
  5.     }
  6.  
  7.     div#ipresenter div#preloader div {
  8.         some styles
  9.     }
  10.  
  11. /* === Steps Section === */
  12.  
  13.     div#ipresenter div.step {
  14.         some styles
  15.     }
  16.  
  17. /* === Control Navigation Section === */
  18.  
  19.     /* = General = */
  20.     a.ipresenter_stepsNav {
  21.         some styles
  22.     }
  23.  
  24.     /* = Next Button = */
  25.     a#ipresenter_nextStep {
  26.         some styles
  27.     }
  28.  
  29.     /* = Previous Button = */
  30.     a#ipresenter_prevStep {
  31.         some styles
  32.     }
  33.  
  34.     /* = Pagination Buttons Container = */
  35.     div.ipresenter-controlNav {
  36.         some styles
  37.     }
  38.  
  39.     /* = Pagination Previous Buttons = */
  40.     div.ipresenter-controlNav a.ipresenter-controlPrevNav {
  41.         some styles
  42.     }
  43.  
  44.     /* = Pagination Next Button = */
  45.     div.ipresenter-controlNav a.ipresenter-controlNextNav {
  46.         some styles
  47.     }
  48.  
  49.     /* = Pagination Number Button = */
  50.     div.ipresenter-controlNav a.ipresenter-control {
  51.         some styles
  52.     }
  53.  
  54.     /* = Pagination Tooltip = */
  55.     div.ipresenter-controlNav div.ipresenter-tooltip {
  56.         some styles
  57.     }
  58.  
  59.     div.ipresenter-controlNav div.ipresenter-tooltip div {
  60.         some styles
  61.     }
  62.  
  63.     div.ipresenter-controlNav div.ipresenter-tooltip img {
  64.         some styles
  65.     }
  66.  
  67. /* === Playback === */
  68.  
  69.     /* = General = */
  70.     #ipresenter-timer {
  71.         some styles
  72.     }
  73.  
  74.     /* = When its playing = */
  75.     #ipresenter-timer.play {
  76.         some styles
  77.     }
  78.  
  79.     /* = When its paused = */
  80.     #ipresenter-timer.pause {
  81.         some styles
  82.     }

所有的图片样式都放置在 div.step 中,你可以自定义它们。如果你要修改它们,只需要找到下面的代码:

  1. div#ipresenter div.step img {
  2.     change styles here
  3. }

JAVASCRIPT:

在页面加载之后,可以使用下面的方法调用该幻灯片插件:

  1. $(document).ready(function(){
  2.     $('#ipresenter').iPresenter();
  3. });

下面列出了该幻灯片插件所有可用的参数:

  1. $(document).ready(function(){
  2.     $('#ipresenter').iPresenter({
  3.         easing: 'ease-in-out',
  4.         autoPlay: true,
  5.         replay: true,
  6.         animSpeed: 1000,
  7.         pauseTime: 5000,
  8.         directionNav: true,
  9.         directionNavHoverOpacity: 0.6,
  10.         controlNav: true,
  11.         controlNavNextPrev: true,
  12.         controlNavHoverOpacity: 0.6,
  13.         controlNavThumbs: false,
  14.         controlNavTooltip: true,
  15.         keyboardNav: true,
  16.         pauseOnHover: false,
  17.         itemsOpacity: 0.4,
  18.         randomStart: false,
  19.         startStep: 0,
  20.         timer: 'Pie',
  21.         timerBg: '#000',
  22.         timerColor: '#EEE',
  23.         timerOpacity: 0.5,
  24.         timerDiameter: 30,
  25.         timerPadding: 4,
  26.         timerStroke: 3,
  27.         timerBarStroke: 1,
  28.         timerBarStrokeColor: '#EEE',
  29.         timerBarStrokeStyle: 'solid',
  30.         timerPosition: 'top-right',
  31.         nextLabel: "Next",
  32.         previousLabel: "Previous",
  33.         playLabel: "Play",
  34.         pauseLabel: "Pause",
  35.         onBeforeChange: function(){},
  36.         onAfterChange: function(){},
  37.         onLastStep: function(){},
  38.         onAfterLoad: function(){},
  39.         onPause: function(){},
  40.         onPlay: function(){}
  41.     });
  42. });

jQuery+CSS3 炫酷图片 3D 旋转幻灯片特效

已有 431 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!