Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@solid/better-simple-slideshow

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid/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

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
159
-46.1%
Maintainers
4
Weekly downloads
 
Created
Source

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 :sparkling_heart: for jQuery though!)
  • can be used with require()

Getting Started

  • 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>    
    
  • Include the script: js/better-simple-slideshow.min.js or js/better-simple-slideshow.js

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

  • 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 :)

FAQs

Package last updated on 30 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts