Javascript知识汇总------手写jq轮播图插件(2018-04-23 17:16)

Posted iwzyuan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Javascript知识汇总------手写jq轮播图插件(2018-04-23 17:16)相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        #box {
            width: 1200px;
            margin: auto;
        }
        .CarFigure_container ul {
            list-style: none;
        }

        .CarFigure_container {
            position: relative;
            width: 100%;
        }
        .CarFigure_outer {
            position: relative;
            width: 100%;
            overflow: hidden;
        }
        .CarFigure_cont {
            position: relative;
            overflow: hidden;
            left: 0;
            transition: all 0.5s ease;
        }
        .CarFigure_cont li {
            float: left;
            box-sizing: border-box;
        }
        .CarFigure_cont li img {
            width: 100%;
        }
        .CarFigure_pagation {
            width: 100%;
            position: absolute;
            bottom: -40px;
            text-align: center;
        }
        .CarFigure_pagation_item.active {
            background: red!important;
        }
        .CarFigure_pagation .CarFigure_pagation_item {
            display: inline-block;
            width: 10px;
            height: 10px;
            background: cadetblue;
            margin: 0 10px;
            border-radius: 100%;
            cursor: pointer;
        }
        .CarFigure_button .CarFigure_button_left,.CarFigure_button .CarFigure_button_right {
            position: absolute;
            width: 40px;
            height: 40px;
            line-height: 40px;
            background: #000000;
            border-radius: 100%;
            overflow: hidden;
            top: 0;
            bottom: 0;
            margin: auto;
            color: #ffffff;
            text-align: center;
            font-size: 25px;
            cursor: pointer;

        }
        .CarFigure_button_left {
            left: -40px;
        }
        .CarFigure_button_right {
            right: -40px;
        }
    </style>
</head>
<body>
    <div id="box">
        <div class="CarFigure_container">
            <div class="CarFigure_outer">
                <ul class="CarFigure_cont">
                    <li class="CarFigure_slider">
                        <img src="test.jpg">
                    </li>
                    <li class="CarFigure_slider">
                        <img src="test.jpg">
                    </li>
                    
                    <li class="CarFigure_slider">
                        <img src="test.jpg">
                    </li>
                    <li class="CarFigure_slider">
                        <img src="test.jpg">
                    </li>
                    <li class="CarFigure_slider">
                            <img src="test.jpg">
                        </li>
                        
                        <li class="CarFigure_slider">
                            <img src="test.jpg">
                        </li>
                        <li class="CarFigure_slider">
                            <img src="test.jpg">
                        </li>
                </ul>
            </div>
            <div class="CarFigure_button"></div>
            <div class="CarFigure_pagation"></div>
        </div>
    </div>
</body>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="jquery.CarFigure.js"></script>
<script>
    $(function (){
       var myCarFigure =  new CarFigure(‘.CarFigure_container‘);
       myCarFigure.init({
           space : 20,
           size : 1
       });
    });
</script>
</html> 

插件地址:https://files.cnblogs.com/files/iwzyuan/jquery.CarFigure.js

 

以上是关于Javascript知识汇总------手写jq轮播图插件(2018-04-23 17:16)的主要内容,如果未能解决你的问题,请参考以下文章

原生javascript手写一个丝滑的轮播图

图片轮播的手写代码

jquery手写轮播功能

jq 跳转方式汇总

jQ选择器汇总

史上最全!56个JavaScript的「手写」知识点,扫盲啦!