Skip to content

tedshd/carousel

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
css
 
 
dev
 
 
 
 
 
 
 
 
 
 
 
 
 
 

carousel

Intro

This is a carousel lib.

Doesn't require any javascript libraries.

Dot on bottom is auto render in js.

Usage

JavaScript

var carousel = new carousel({
    dom: document.getElementById('demo_1'),
    viewCount: 3
});
  • dom - html dom element
  • viewCount - the li count want to show on view, and slide this count

HTML

<!-- id is not require -->

<div id="demo_1" class="mod_carousel">
    <div class="mod_carousel_container">
        <ol>
            <li class="">content</li>
            <li class="">content</li>
            <li class="">content</li>
        </ol>
    </div>
    <div class="mod_carousel_arrow_l" data-state="hide"></div>
    <div class="mod_carousel_arrow_r" data-state="hide"></div>
</div>