• Stars
    star
    1,507
  • Rank 31,119 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 12 years ago
  • Updated almost 6 years ago

Reviews

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

Repository Details

A fullscreen, hardware accelerated slider for jQuery.

/!\ This project is currently unmaintained

If you're interested in maintaining this project and triaging bugs chime in on this issue.

Superslides

Superslides is a full screen, hardware accelerated slider for jQuery. I wasn't happy with the state of full screen sliders, so naturally I built my own.

Usage

Check out the demo for an interactive example or the examples folder for individual cases. Use like your standard jQuery plugin:

$('#slides').superslides()

Options

Option Default Description
play 0 [number] Milliseconds before progressing to next slide automatically. Use a falsey value to disable.
animation 'slide' [string] slide or fade. This matches animations defined by fx engine.
animation_speed 'normal' [string] Animation speed.
animation_easing 'linear' [string] Animation easing.
inherit_width_from window [object] or [string] Accepts window or element selector. Use to constrain slider to an element's width.
inherit_height_from window [object] or [string] Accepts window or element selector. Use to constrain slider to an element's height.
pagination true [boolean] Generate pagination. Add an id to your slide to use custom pagination on that slide.
hashchange false [boolean] Enable hashchange support in url.
elements (see Elements below) [object] A hash of element classes used in generated html.

Elements

The following are element classes accessible under the elements object.

preserve '.preserve' [string] Add this class to images in your content that you don't want to be resized like the background images.
nav '.slides-navigation' [string] Class surrounding next/previous buttons.
container '.slides-container' [string] Container class that must be present with original markup.
pagination '.slides-pagination' [string] Pagination class added to pagination container.

Events

Superslides triggers a few events that you can bind to.

started.slides
init.slides
animating.slides // Before slide animation begins
animated.slides  // After slide animation ends
updated.slides

API

$('#slides').superslides('start')
$('#slides').superslides('stop')
$('#slides').superslides('animate' [, index|'next'|'prev'])
$('#slides').superslides('size')
$('#slides').superslides('destroy')
$('#slides').superslides('current') // get current slide index
$('#slides').superslides('next')    // get next slide index
$('#slides').superslides('prev')    // get previous slide index

If adding slides after initialization (a la ajax), be sure to call update.

Styling

All styling required for functionality is handled in the JavaScript. Additional and optional styling is provided in dist/stylesheets/superslides.css

Markup

Markup is pretty straightforward. At minimum it looks something like this:

<div id="slides">
  <div class="slides-container">
    <img src="http://flickholdr.com/1000/800" alt="">
    <img src="http://flickholdr.com/1000/800" alt="">
  </div>
</div>

You could even use a UL as the slides-container

<div id="slides">
  <ul class="slides-container">
    <li>
      <img src="http://flickholdr.com/1000/800" alt="">
      <div class="container">
        Slide one
      </div>
    </li>
    <li>
      <img src="http://flickholdr.com/1000/800/space" alt="">
      <div class="container">
        Slide two
      </div>
    </li>
    <li>
      <img src="http://flickholdr.com/1000/800/tech" alt="">
      <div class="container">
        Slide three
      </div>
    </li>
  </ul>
  <nav class="slides-navigation">
    <a href="#" class="next">Next</a>
    <a href="#" class="prev">Previous</a>
  </nav>
</div>

Custom Animations

I realize that you might want to do something unique in your application. That's why I've added the ability to extend the existing animations with your own. See examples/custom-fx.html.

$.fn.superslides.fx = $.extend({
  flip: function(orientation, complete) {
    console.log(orientation);
    complete();
  }
}, $.fn.superslides.fx);

Hardware Acceleration

Superslides is compatible with the jQuery Animate Enhanced plugin. Simply include it before this plugin and it will automatically smooth out transitions using CSS instead of JavaScript.

Contributing

Check contributing.md.

Changelog

Changelog

More Repositories

1

lets-split-guide

This guide covers building a Let's Split v2
Makefile
617
star
2

glances

A heads-up dashboard for displaying thing-statuses.
JavaScript
63
star
3

shortcode.js

Replace Wordpress-style shortcodes with anything.
JavaScript
54
star
4

react-native-line-gauge

A sliding linear gauge (or rule) to pick values easily
JavaScript
35
star
5

Geektool-Scripts

A collection of geektool scripts, moved from nicinabox.com
Perl
34
star
6

cassidy

It makes passwords, yo
CoffeeScript
29
star
7

spanner

A simple maintenance tracking tool for your vehicles.
TypeScript
12
star
8

wp2refinery

Import wordpress database into refinery blog
Ruby
12
star
9

plistbuddy

A handy tool to manipulate plist files. Useful for iOS development.
JavaScript
11
star
10

trolley

A tool for managing official Slackware packages, designed for unRAID.
Ruby
10
star
11

boxcar

An admin interface for unRAID. Built with Sinatra and Bootstrap.
Ruby
10
star
12

swapwatch

Makes r/mechmarket and r/hardwareswap human readable.
JavaScript
6
star
13

petrie

Pages for your Rails app
Ruby
5
star
14

geeklets

A collection of Geektool scripts wrapped in a gem.
Ruby
5
star
15

glances-example

JavaScript
4
star
16

boiler

The missing package manager for unRAID
Ruby
4
star
17

saucer-api

A basic API for getting Flying Saucer store locations, beers, and beer details.
JavaScript
3
star
18

github-light-header

Show the light Github header instead of the dark one
JavaScript
3
star
19

Hatchpass

Secure, mathematical password creation
PHP
3
star
20

qmk-cli

A thin wrapper around QMK + new features
Ruby
3
star
21

keymaps

My QMK keymaps and utils
C
3
star
22

jasmine-rails-boilerplate

Ruby
3
star
23

nicinabox.github.io

Site archive
CSS
2
star
24

Hatchpass-BackboneJS

CoffeeScript
2
star
25

homebridge-http-entry

TypeScript
2
star
26

slackware-packages

A Slackware packages API for unRAID
Ruby
2
star
27

removeplg

The antithesis of installplg.
Python
2
star
28

Workbench

A computer worklogs system designed for MTSU
JavaScript
2
star
29

mini-timer

Features a small info/stats set with animations
JavaScript
1
star
30

hatchpass-chrome

Chrome extension for Hatchpass
JavaScript
1
star
31

slapp

SLAckware Package Parser
Ruby
1
star
32

boxcar-addons

Addon registry for Boxcar
CSS
1
star
33

foundation-activeadmin

A Foundation based layout for ActiveAdmin
Ruby
1
star
34

timer

HTML5 Timer
JavaScript
1
star
35

refinerycms-generators

Refinery CMS Generators
Ruby
1
star
36

binary-clock

A simple binary clock built with React.
JavaScript
1
star
37

slackpack

Simple package building for Slackware. Designed for unRAID.
Python
1
star
38

nicinabox

My personal site using a static site generator and continuous deployment.
JavaScript
1
star
39

bourbon-buttons

Bourbon's button mixin made compatible with Compass
Ruby
1
star
40

Saucer

A React Native prototype using data from http://saucer-api.herokuapp.com
JavaScript
1
star
41

gitsync

A hands off tool for keeping a directory or dropbox under git control
Ruby
1
star
42

hatchpass-sinatra

Secure password creation
JavaScript
1
star
43

Hatchpass-Userscript

Userscript that interfaces with hatchpass that allows you to type the master in-page
1
star