基于jQuery实现键盘控制图像滑块切换



58 228 77



特效描述:基于jQuery实现 键盘控制 图像滑块切换,基于jQuery实现键盘控制图像滑块切换

代码结构

1. 引入CSS

<link href="demo/assets/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="demo/assets/css/style.css" />
<link rel="stylesheet" href="css/lush.animations.css" />
<link rel="stylesheet" href="css/lush.min.css" />
<link href="demo/assets/css/bootstrap-responsive.css" rel="stylesheet">

2. 引入JS

<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="ga.js"></script>
<script src="demo/assets/js/jquery.js"></script>
<script src="demo/assets/js/bootstrap.min.js"></script>
<script src="js/jquery.easing.1.3.min.js"></script>
<script src="js/jquery.lush.js"></script>

3. HTML代码

    <div class="container">
      <br>
      <div class="row">
        <div class="span12">
          <!-- Lush Slider -->
          <ul class="lush-slider shadow-a">
            <li class="lush">
                <img src="demo/slider/sky.png"
                      data-slide-in="at 100 from back use easeInCirc during 600" 
                      data-slide-out="at 15500 to back-left use swing during 600" 
                      style="top: 0; left: 0; " />   
                <img src="demo/slider/clouds.png"
                      data-slide-in="at 3400 from r use easeOutCirc during 3000" 
                      data-slide-out="at 9500 to l use easeInCirc during 600" 
                      style="top: 0; left: 0; " />   
                <img src="demo/slider/clouds.png"
                      data-slide-in="at 5000 from r use easeOutQuart during 3000" 
                      data-slide-out="at 8000 to left use easeInCirc during 600" 
                      style="top: 10%; left:15%; " />   
                <img src="demo/slider/tree-1.png" id="arbol"
                      data-slide-in="at 2500 from bottom use easeOutQuart during 600" 
                      data-slide-out="at 12000 to back use easeInBack during 600" 
                      style="top: 20%; left: 2%; " />   
                <img src="demo/slider/tree-2.png"
                      data-slide-in="at 2600 from bottom use easeOutQuart during 600" 
                      data-slide-out="at 12100 to back use easeInBack during 600" 
                      style="top: 20%; left: 22%; " />   
                <img src="demo/slider/tree-3.png"
                      data-slide-in="at 2700 from bottom use easeOutQuart during 600" 
                      data-slide-out="at 12200 to back use easeInBack during 600" 
                      style="top: 20%; left: 55%; " />   
                <img src="demo/slider/tree-4.png"
                      data-slide-in="at 2800 from bottom use easeOutQuart during 600" 
                      data-slide-out="at 12300 to back use easeInBack during 600" 
                      style="top: 20%; left: 75%; " />   
                <img src="demo/slider/pasto.png"
                      data-slide-in="at 2000 from right use easeOutCirc during 400" 
                      data-slide-out="at 13600 to left use easeInBack during 600" 
                      style="bottom: 0; left: 0; " />   
                <h1 class="t-white"
                    data-slide-in="at 5000 from front use easeOutBack  during 500"  
                    data-slide-out="at 10500 to front use easeInBack during 600"
                    style="top: 30%; left: 30%;">Lush Slider</h1>
                <h2 id="a1" class="t-yellow rounded"
                    data-slide-in="at 6000 from l use easeOutCirc during 2500"  
                    data-slide-out="at 1500 to r use easeInCirc during 600 force"
                    style="top: 55%; left: 40%;">A powerful component slider</h2>
                <h2 class="t-yellow rounded"
                    data-slide-in="at 6000 from r use easeOutCirc during 2500"  
                    data-slide-out="at 1500 to l use easeInCirc  during 600 force"
                    style="top: 70%; left: 30%;">powered by CSS3 and jQuery</h2>
                <h2 class="t-yellow rounded"
                    data-slide-in="at 10000 from l use easeOutCirc during 2500"  
                    data-slide-out="at 1500 to r use easeInCirc during 600"
                    style="top: 55%; left: 40%;">A flexible slider </h2>
                <h2 class="t-yellow rounded"
                    data-slide-in="at 10000 from r use easeOutCirc during 2500"  
                    data-slide-out="at 1500 to l use easeInCirc  during 600"
                    style="top: 70%; left: 30%;">with better performance in animations </h2>
            </li> 
            <li class="lush" id="l3">
              <img src="demo/slider/soundbg.png"
                   data-slide-in="at 100 from back-right use easeInQuad during 600" 
                   data-slide-out="at 10900 to back-bottom use easeInQuad during 400"
                   style="top: 0; left: 0;" />   
              <img src="demo/slider/soundline.png"
                   data-slide-in="plus 700 from flip-h use easeInQuad during 600"
                   data-slide-out="at 9800 to flip-h use easeInQuad during 400" 
                   style="top: 40%; left: 0;" />   
              <img src="demo/slider/woofer1.png"
                   data-slide-in="plus 500 from back use easeOutBack during 600"
                   data-slide-out="at 8000 to back-bottom use easeInQuad during 400" 
                   style="top: 10%; left: 40%;" />   
              <img src="demo/slider/woofer2.png"
                   data-slide-in="plus 200 from back use easeOutBack during 600"
                   data-slide-out="plus 100 to back-bottom use easeInQuad during 400" 
                   style="top: 30%; left: 58%;" />   
              <img src="demo/slider/woofer3.png"
                   data-slide-in="plus 200 from back use easeOutBack during 600"
                   data-slide-out="plus 100 to back-bottom use easeInQuad during 400" 
                   style="top: 40%; left: 30%;" />   
              <img src="demo/slider/woofer4.png"
                   data-slide-in="plus 200 from back use easeOutBack during 600" 
                   data-slide-out="plus 100 to back-bottom use easeInQuad during 400"
                   style="top: 58%; left: 39%;" />   
              <h1 class="t-red rounded"
                  data-slide-in="plus 200 from front use easeOutBack during 600"
                  data-slide-out="at 4000 to front use easeInBack during 600"
                  style="top: 10%; left: 5%;">Let's get <br /><b>LOUDER</b></h1>
              <h2 class="t-red rounded"
                  data-slide-in="plus 700 from flip-h use easeOutBack during 600"
                  data-slide-out="plus 100 to left use easeInBack during 600"
                  style="top: 60%; left: 5%;">Latest <i>advanced</i> animations</h2>
              <h2 class="t-red rounded"
                  data-slide-in="plus 200 from flip use easeOutBack during 600"
                  data-slide-out="plus 100 to left use easeInBack during 600"
                  style="top: 75%; left: 5%;">to make your own <i>Lush</i> presentation</h2>
              <h3 class="t-orange rounded"
                  data-slide-in="plus 1200 from rtr use easeOutCirc during 600"
                  data-slide-out="at 3900 to front-left use easeOutBack during 600"
                  style="top: 10%; left: 70%;">Easy Markup</h3>
              <h3 class="t-orange rounded"
                  data-slide-in="plus 100 from ltr use easeOutCirc during 600"
                  data-slide-out="plus 100 to front-right use easeOutBack during 600"
                  style="top: 20%; left: 70%;">Semantic sintax</h3>
              <h3 class="t-orange rounded"
                  data-slide-in="plus 100 from ltr use easeOutCirc during 600"
                  data-slide-out="plus 100 to front-left use easeOutBack during 600"
                  style="top: 30%; left: 70%;">Extensible animations</h3>
              <h3 class="t-orange rounded"
                  data-slide-in="plus 100 from ltr use easeOutCirc during 600"
                  data-slide-out="plus 100 to front-right use easeOutBack during 600"
                  style="top: 40%; left: 70%;">Native transitions</h3>
              <h3 class="t-orange rounded"
                  data-slide-in="plus 100 from rtr use easeOutCirc during 600"
                  data-slide-out="plus 100 to front-left use easeOutBack during 600"
                  style="top: 50%; left: 70%;">Best performance</h3>
              <h3 class="t-orange rounded"
                  data-slide-in="plus 100 from rtr use easeOutCirc during 600"
                  data-slide-out="plus 100 to front-right use easeOutBack during 600"
                  style="top: 60%; left: 70%;">Fully Responsive</h3>
              <h3 class="t-orange rounded"
                  data-slide-in="plus 100 from ltr use easeOutCirc during 600"
                  data-slide-out="plus 100 to front-left use easeOutBack during 600"
                  style="top: 70%; left: 70%;">Crossbrowser support</h3>
            </li>
            <li class="lush" id="l1">
                <img src="demo/slider/darkbg.png"  
                     data-slide-in="at 0 from back-top use easeOutExpo  during 800"  
                     data-slide-out="at 7000 to back use easeInBack during 600"/>
                <h2 class="t-white"
                    data-slide-in="at 500 from back use easeOutBack  during 500"  
                    data-slide-out="at 3500 to lbr use easeInBack during 600"
                    style="top: 10%; left: 10%;">ENHANCED YOUR SLIDER</h2>
                <h3 class="t-yellow-b"
                    data-slide-in="at 1500 from back-rotate2 use easeOutQuart during 500"  
                    data-slide-out="at 3500 to rbr use easeInBack during 600"
                    style="top: 30%; left: 10%;">POWERED BY</h3>
                <h2 class="t-white-b"
                    data-slide-in="at 1700 from front-rotate use easeOutQuart during 800" 
                    data-slide-out="at 3500 to right use easeInBack during 600" 
                    style="top: 40%; left: 10%; ">FLEXSLIDER</h2>
                <h1 class="t-yellow-b"
                    data-slide-in="at 2300 from back use easeOutBack  during 600"  
                    data-slide-out="at 3000 to front-rotate use easeInBack during 600"
                    style="top: 50%; left: 20%;">+</h1>
                <h2 class="t-white-b"
                    data-slide-in="at 1800 from front-rotate use easeOutQuart during 800" 
                    data-slide-out="at 3000 to left use easeInBack during 600" 
                    style="top: 70%; left: 10%; ">LUSH CONTENT SLIDER</h2>   
                <img src="demo/slider/lamp.png"
                      data-slide-in="at 3200 from front use easeOutQuart during 500" 
                      data-slide-out="at 3000 to back use easeInBack during 600" 
                      style="top: 10%; left: 65%; " />   
                <a href="#"
                    data-slide-in="at 3500 from top use easeOutCirc during 600" 
                    data-slide-out="at 2600 to front-rotate use easeInBack during 600" 
                    style="top: 5%; left: 80%; "> 
                      <img src="demo/slider/bubble.png"/>
                </a>   
            </li>          
          </ul>
          <!-- /Lush Slider -->
        </div>
      </div>
      <div id="feat"></div>
    </div> <!-- /container -->
        <script>
            $(function() {
                $('#feat').load('features.html')
                $('.lush-slider').lush({
                  slider: {pauseOnHover: true}
                });
            })
        </script>
<div style="text-align:center;clear:both">
</div>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 导航切换 图片头像上传 带标题的焦点图 缩略图 文件上传 带缩略图的幻灯片 图片相册 带简介的焦点图 图片切换 文本框 图片轮播 图片墙 文字切换 下拉框 自动滚动图片轮播 百叶窗 背景切换 复选 图片网格 马赛克幻灯片 手风琴 单选 图片九宫格 全屏焦点图 选项卡自动切换 登录框 视频切换 注册框 图片高亮 列表切换 搜索框 图片对比 验证码 图片文字 渐隐切换 二级联动 单排图片 全屏切换 三级联动 响应式图片 切换按钮 城市选择 图片列表 缩放切换 value赋值 筛选 按钮控制 购物车 颜色选择 表单提交 全选/反选 添加删除 添加标签 密码强度验证 表单验证 html5按钮动画 按钮样式 密码修改设置 图片拖动 图片放大镜 图片叠加 图片翻转旋转 图片延迟加载 图片淡出淡进 图片全屏 图片头像上传 二维码 滚动切换 滑动选项卡切换 图片广告 图片放大缩小 html5图片动画 带缩略图的幻灯片 地图 flash焦点图 图片滚动 图片滑动 图片切换 图片收缩展开 旋转木马 图片轮播 自动滚动图片轮播 图标导航菜单 选项卡切换 滑动手风琴 背景切换 手风琴 切换按钮 form表单 图表 焦点图幻灯片 图片 头像截图

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到