jQuery.skipper全屏响应式图片幻灯片轮播切换代码



149 595 199



特效描述:jQuery.skipper 全屏响应式图片 幻灯片 轮播切换,全屏响应式图片幻灯片轮播切换代码

代码结构

1. 引入CSS

<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="skippr/css/jquery.skippr.css">

2. 引入JS

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="skippr/js/jquery.skippr.js"></script>

3. HTML代码

        <!--[if lt IE 7]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->
        <div class="hero">
            <div id="random">
                <div class="yellow"></div>
                <div style="background-image: url(img/test2.jpg)"></div>
                <div style="background-image: url(img/test5.jpg)"></div> 
                <div style="background-image: url(img/test3.jpg)"></div>                   
                <div style="background-image: url(img/test4.jpg)"></div>
            </div>
            <!-- <div id="random">
                <img src="img/test3.jpg">
                <img src="img/test4.jpg">
                <img src="img/test1.jpg">
                <img src="img/test5.jpg">
            </div> -->
            <div class="container">
                <div class="tagline">
                    <h1>Skippr.</h1>
                    <p>A faster, lighter slideshow plugin.<br> Only 3kb minified.</p>
                </div>
                <div class="downloads">
                    <div class="btn-container">
                         <a href="skippr-master.zip" target="_blank"><div class="btn">Download</div></a>
                        <a href="http://www.github.com/austenpayan/skippr" target="_blank"><div class="btn">Github</div></a>
                    </div>
                </div>
            </div>
        </div>
        <div class="content">
            <h2>The setup.</h2>
            <p>Include jquery.skippr.css inside your head tag and jquery.skippr.js just before the closing body tag.</p>
            <p>Be sure to include jQuery before jquery.skippr.js</p>
            <pre>
            <code id="code-header">
    &lt;head>
        &lt;title>Your Awesome Website&lt;/title>        
        &lt;link rel="stylesheet" href="css/jquery.skippr.css"&gt;
    &lt;/head>
    &lt;body>
            </code>
            </pre>
            <pre>
            <code id="code-footer">
        &lt;script src="//code.jquery.com/jquery-1.11.0.min.js">&lt;/script>
        &lt;script src="js/jquery.skippr.js">&lt;/script>
    &lt;/body>
            </code>
            </pre>
            <p>Create a target element with divs inside, one for each slide, 
                and add a background image with css or the style attribute.
                Skippr targets div tags inside of the selected element with background-images applied to them.
                Put this target element inside of a container element styled and positioned to your liking.
                The target element will completely fill it's parent container element.</p>
            <p>&nbsp;</p>
            <p>**Note: The container element must have a specified width and height, and position other than static to work properly.</p>
            <pre>
            <code id="code-elements">
        &lt;div id="container">
            &lt;div id="theTarget">
                &lt;div style="background-image: url(img/image1.jpg)">
                &lt;div style="background-image: url(img/image2.jpg)">
                &lt;div style="background-image: url(img/image3.jpg)">
                &lt;div style="background-image: url(img/image4.jpg)">
                &lt;div style="background-image: url(img/image5.jpg)">
            &lt;/div>    
        &lt;/div>
            </code>
            </pre>
            <h2>Initiate.</h2>
            <p>Just select the parent element with jQuery and call the skippr method. Thats it!</p>
            <pre>
            <code id="code-initiate">
        $(document).ready(function(){
            $("#theTarget").skippr();
        });    
            </code>
            </pre>
            <h2>Options.</h2>
            <p>Pass in an options object as a parameter to the skippr method for customization.</p>
            <pre>
            <code id="code-options">
        <span class="code-comment">// Defaults </span>  
        $("#theTarget").skippr({
            speed: 500,
            navType: 'block',
            childrenElementType: 'div',
            arrows: true,
            autoPlay: false,
            autoPlayDuration: 5000
        });
            </code>
            </pre>
            <p><b>speed</b> : enter length of time in milliseconds you want the transition between slides to take. Default is 500.</p>
            <p><b>navType</b> : enter a string of what shape you want the navigation elements to be. Skippr currently
                takes either "block" or "bubble". Default is "block".</p>
            <p><b>childrenElementType</b> : choose the children element type of the target element. Skippr now accepts either 'div' or 'img'. Default is 'div'.  </p>
            <p><b>arrows</b> : boolean value determining whether or not to display navigation arrows. Default is true. Set to false to hide arrows.</p>
            <p><b>autoPlay</b> : boolean value determining whether or not to use auto-playing functionality in the slideshow. Default is false. Set to true to activate auto-play. </p>
            <p><b>autoPlayDuration</b>  <span class="new-option">new</span> : sets the amount of time in milliseconds to display each slide when autoPlay is running. Default is 5000 milliseconds.</p>
            <hr>
            <p>Skippr will be an ongoing project.</p>
            <p>Check back or star on Github for updates.</p>
            <hr>
        </div>
        <div class="hero">
            <div id="random2">
                <div style="background-image: url(img/test2.jpg)"></div>
                <div style="background-image: url(img/test5.jpg)"></div> 
                <div style="background-image: url(img/test3.jpg)"></div>                   
                <div style="background-image: url(img/test4.jpg)"></div>
            </div>
        </div>
        <div class="download">
            <div>
                <h1>Get it.</h1>
                <div class="btn-container">
                    <a href="skippr-master.zip" target="_blank"><div class="btn">Download</div></a>
                     <a href="http://www.github.com/austenpayan/skippr" target="_blank"><div class="btn">Github</div></a>
                </div>
            </div>
        </div>
        <footer>
            <div class="info">
                <p>created by austen payan</p>
                <p><a href="mailto:austenpayan@gmail.com">austenpayan@gmail.com</a></p>
                <p><a href="http://iamapioneer.com" target="_blank">iamapioneer.com</a></p>
            </div>
        </footer>
           <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
           <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
        <script src="skippr/js/jquery.skippr.js"></script>
        <script>
            $(document).ready(function() {
                $("#random").skippr();
                $("#random2").skippr({
                    navType: 'bubble',
                    autoPlay: true,
                    autoPlayDuration: 2000
                });
            });
        </script>
        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
        <script>
            (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
            function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
            e=o.createElement(i);r=o.getElementsByTagName(i)[0];
            e.src='//www.google-analytics.com/analytics.js';
            r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
            ga('create','UA-XXXXX-X');ga('send','pageview');
        </script>



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


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

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

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

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