GithubHelp home page GithubHelp logo

limbu-malongo / better-simple-slideshow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leemark/better-simple-slideshow

0.0 2.0 0.0 3.98 MB

Another simple DIY responsive image slideshow made with HTML5, CSS3, and JavaScript

Home Page: http://leemark.github.io/better-simple-slideshow/

License: Mozilla Public License 2.0

JavaScript 37.85% CSS 30.15% HTML 32.01%

better-simple-slideshow's Introduction

A Better Simple Slideshow

This is a fairly basic slideshow, written in javascript. This is a dual-purpose project, it's meant to be something you can drop right into your page and use if you so choose, but it's also meant as an example/tutorial script showing how to build a simple DIY slideshow from scratch on your own. Here is a tutorial/walkthrough.

Features

  • fully responsive
  • option for auto-advancing slides, or manually advancing by user
  • multiple slideshows per-page
  • supports arrow-key navigation
  • full-screen toggle using HTML5 fullscreen api
  • swipe events supported on touch devices (requires hammer.js)
  • written in vanilla JS--this means no jQuery dependency (much ๐Ÿ’– for jQuery though!)

Getting Started

  1. HTML markup for the slideshow should look basically like this, with a container element wrapping the whole thing (doesn't have to be a <div>) and each slide is a <figure>.

        <div class="bss-slides">
            <figure>
                <img src="path/to/img" width="100%" />
                <figcaption>Caption goes here</figcaption> 
            </figure>
    
            <!-- more figures here as needed -->
    
        </div>    
  2. Include the script: js/better-simple-slideshow.min.js or js/better-simple-slideshow.js

  3. Include the stylesheet css/simple-slideshow-styles.css

  4. Initialize the slideshow:

    <script>
        makeBSS('.bss-slides');
    </script>

Options

To customize functionality, create an options object, then pass it into makeBSS() as the second argument, as seen below:

var opts = {
            //auto-advancing slides? accepts boolean (true/false) or object
            auto : { 
                // speed to advance slides at. accepts number of milliseconds
                speed : 2500, 
                // pause advancing on mouseover? accepts boolean
                pauseOnHover : true 
            },
            // show fullscreen toggle? accepts boolean
            fullScreen : true, 
            // support swiping on touch devices? accepts boolean, requires hammer.js
            swipe : true 
        };
        
makeBSS('.bss-slides', opts);

Demo/Examples

See demo slideshows here.

Better Than What?

The name "Better Simple Slideshow" isn't meant to disparage your favorite javascript slideshow, or to imply that this is the best slideshow script out there (far from it, actually). It's just meant to be better than the earlier version that it evolved out of :)

better-simple-slideshow's People

Contributors

leemark avatar katiek2 avatar

Watchers

James Cloos avatar Limbu M. Limbu 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.