Giter VIP home page Giter VIP logo

mumf-slider's Introduction

Mumf Slider

A basic jQuery plugin for generating sliders for HTML content and/or image galleries.

Main Features

  • Can be used for image galleries and HTML content.
  • Fully responsive. Both on browser resize and between slides if difference in slide height exists.
  • Easy to customize
    • The plugin is modular in that it's functions can be overwritten and added to. For instance you can add your own slide transition effect.
    • Custom themes can be created and used by adding them to the mumf-slider/themes/ directory and adding a reference to it's CSS file.
    • Options can be changed on slider instantiation to enable/disable auto rotation, navigation, default thumbnails, and many more.

Project Setup

What you'll need to get the project running

  1. = jQuery v1.9.0 for browsers other than IE < 10 which require >= jQuery v1.10.1

Deploying

Simply add a reference to the mumf-slider/js/mumf-slider.js file within your index.html, using a JavaScript require framework such as Head.js or however you include your JavaScript files.

Markup Required before Slider Instantiation

Basic Structure of slider

The basic structure of the slider is as follows:

<!-- Slider container (The element you will use when instantiating slider) -->
<div class="slider">

    <!-- Used to hold all slides. -->
    <ul>
    
        <!-- Single slide. -->
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <div>           
                <!-- This level contains the slide content which can be simply images, 
                     HTML elements or a mix of the two.
                -->
                <img src="img/1.jpg" alt="1">
            </div>
        </li>
                       
    </ul>
</div>

Basic Structure of thumbnails

If you want thumbnails to be used for navigation you can add the element within your slider element.

The basic structure of the slider thumbnails is as follows:

<!-- Thumbnail container -->
<div class="thumbnails">
    <!-- Used to hold each thumbnail -->
    <ul>
        <!-- Single thumbnail -->
        <li class="">
            <!-- Container for thumbnail -->
            <div>                       
                <!-- You can use HTML or a simple image element -->
                <img src="img/1.jpg" alt="1">
            </div>
        </li>
    </ul>                    
</div>

Image Slider

The HTML markup to be used for image sliders must use the following structure:

<div class="slider">
    <ul>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <div>                                
                <img src="img/1.jpg" alt="1">
            </div>
        </li>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <a href="http://link/to/content">
                <img src="img/2.jpg" alt="2">
            </a>
        </li>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <div>
                <img src="img/3.jpg" alt="3">
            </div>
        </li>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <div>
                <img src="img/4.jpg" alt="4">
            </div>
        </li>                        
    </ul>
</div>

HTML Slider

The HTML markup to be used for image sliders must use the following structure:

<div class="slider">
    <ul>
        <li class="slide">
            <div>                                
                <!-- Your HTML content here. -->             
            </div>
        </li>    
        <li class="slide">
            <div>                                
                <div class="item">
                    <h4>Heading</h4>
                    <p>Paragraph</p>
                </div>
                <div class="item">
                    <h4>Heading</h4>
                    <p>Paragraph</p>
                </div>                
            </div>
        </li>
        <li class="slide">
            <div>                                
                <div class="item">
                    <h4>Heading</h4>
                    <p>Paragraph</p>
                </div>
                <div class="item">
                    <h4>Heading</h4>
                    <p>Paragraph</p>
                </div>                
            </div>
        </li>
    </ul>
</div>

Slider with thumbnails

The HTML markup to be used for image sliders with thumbnail navigation must use the following structure:

<!-- Slider -->
<div class="slider">
    <ul>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <div>                                
                <img src="img/1.jpg" alt="1">
            </div>
        </li>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <a href="http://link/to/content">
                <img src="img/2.jpg" alt="2">
            </a>
        </li>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <div>
                <img src="img/3.jpg" alt="3">
            </div>
        </li>
        <li class="slide">
            <!-- This element level can either be a div or link element -->
            <div>
                <img src="img/4.jpg" alt="4">
            </div>
        </li>                        
    </ul>

    <div class="thumbnails">
        <ul>
            <li class="">
                <div>                                
                    <img src="img/1.jpg" alt="1">
                </div>
            </li>
            <li class="">
                <div>
                    <img src="img/2.jpg" alt="2">
                </div>
            </li>
            <li class="">
                <div>
                    <img src="img/3.jpg" alt="3">
                </div>
            </li>
            <li class="">
                <div>
                    <img src="img/4.jpg" alt="4">
                </div>
            </li>                        
        </ul>                    
    </div>
</div>

    </div>
</div>
<!--/Slider -->

Instantiating Slider

  • Basic slider instantiated using
$('.slider-fade').mumfSlider();
  • Override default settings using
$('.slider-fade').mumfSlider({ 
   theme: 'custom-theme',
   transition: 'slide',
   autoRotate: false,
   rotateDelay: 4000,
   showNavigation: false,
   navButtonsHtml: '<div class="next direction" data-direction="next"></div><div class="prev direction" data-direction="previous"></div>',
   navigationThumbnails: false     
});

mumf-slider's People

Contributors

bombadillo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.