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



102 407 136



特效描述: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>



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


热门标签: 图片叠加 图片层叠 图片拖动 图片拖拽 图片翻转 图片旋转 图片延迟加载 图片延迟 图片加载 图片淡出淡进 图片淡出 图片淡进 图片全屏 头像上传 图片上传 二维码 图片放大镜 h5图片动画 h5图标动画 html5图片动画 html5图标动画 带缩略图的幻灯片 地图 中国地图 世界地图 滑动 滑块 滑动门 触屏滑动 滑动插件 滑块插件 图片放大缩小 图片缩放 图片大小 图片放大 图片缩小 图片变大 图片变小 flash焦点图 flash幻灯片 flashbanner flash图片轮播 滚动切换 滚动条切换 图片广告 滑动选项卡 滑动切换 纯图片轮播 图片轮播 图片滚动 图片滚动条 图片滑动 图片滑块 旋转木马 图片旋转木马 文字旋转木马 旋转木马插件 图片切换 图片选项卡 图标选项卡 图片收缩展开 图片收缩 图片展开 图标导航 图标菜单 自动滚动图片轮播 滑动手风琴 背景切换 大图切换 选项卡切换 选项卡 切换 tab切换 页面切换 选项卡插件 切换插件 手风琴 水平手风琴 垂直手风琴 图片手风琴 文字手风琴 手风琴插件 切换按钮 表单 表单美化 表单插件 表单美化插件 图表 焦点图 幻灯片 轮播图 bar焦点图 图片 图片插件 头像截图 图片滑动 图片滑块 图片切换 图片选项卡 图标选项卡 纯图片轮播 图片轮播 全屏焦点图 响应式图片 按钮控制

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

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

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