• Stars
    star
    176
  • Rank 216,987 (Top 5 %)
  • Language
    JavaScript
  • License
    Mozilla Public Li...
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 = {
            // default selector is "figure"
            selector: ".my-selector",
            //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 :)

More Repositories

1

co-data-pull

An example of pulling State of Colorado open data as JSON
HTML
23
star
2

embed360

Easily embed multiple 360 photos in a web page using aframevr
JavaScript
23
star
3

expandy-thing

Just a dead simple jQuery plugin to show+hide content on a web page.
JavaScript
4
star
4

answer_engine

combines web search, Retrieval-Augmented Generation (RAG), reflection, summarization, and follow-up question generation to provide comprehensive answers to user queries
Python
4
star
5

simple-slideshow

A simple DIY responsive slideshow made with HTML5, CSS3, and JavaScript
JavaScript
4
star
6

aframe-earth

playing around with aframe + glitch
3
star
7

contents.js

JavaScript
2
star
8

langchain_playbook

a collection of basic Python examples utilizing Langchain to showcase various chat interfaces and Retrieval-Augmented Generation (RAG) strategies
Python
2
star
9

carpe

HTML
1
star
10

rsrch

Python
1
star
11

web_tools

a collection of AI-enhanced Python scripts designed to augment the digital experience, from improving web accessibility to optimizing content for better engagement
Python
1
star
12

llamaindex_playbook

A collection of basic Python examples utilizing LlamaIndex to showcase various chat interfaces and Retrieval-Augmented Generation (RAG) strategies
Python
1
star
13

langgraph-starter

Python
1
star
14

crewai-start

Python
1
star
15

langchain_web_srch

Python
1
star
16

crewai_ollama

Python
1
star
17

llm_lc_ex

Python
1
star
18

colortest

involves rgb
JavaScript
1
star
19

campusmap-webapp

HTML
1
star
20

cmap

rethinking the campus map
JavaScript
1
star
21

cardflip

CSS
1
star
22

sp-nav

For single-page navigation menus.
JavaScript
1
star
23

hello-world

This is my first repository, just to get me up and running with github.
JavaScript
1
star
24

webvr-testing

testing some webvr stuff
JavaScript
1
star
25

ai-enhanced-search

Python
1
star