Git Product home page Git Product logo

superslides's Introduction

/!\ 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

superslides's People

Contributors

ayarulin avatar benkroeger avatar ergec avatar mkurz avatar nicinabox avatar nzy avatar xima-eko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

superslides's Issues

'slides-navigation' slides all instances of superslides on page

I have a single-page scrolling site that utilizes multiple instances of superslides to slide content for each section. Both work great, but the slides-navigation for each is envoking ALL instances of superslides, instead of only the one it's a part of.

I'm calling superslides as so:

$('.sub-pages').each(function() {
    $(this).superslides({
        slide_easing: 'easeInOutExpo',
        slide_speed: 800,
        pagination: true,
        hashchange: false,
        scrollabe: true
    });
});

What does "scrollable" do?

There is no explanation what that property represents.
Also demo out of the box is broken, css not properly linked and you have an error in application.js ( scrollabe instead of scrollable)

Fixed Position objects and Chrome

I'm running into an issue with this plugin messing with fixed position objects in Chrome. I have a header and a footer set as fixed. They work fine in FF, but in Chrome the jump around and redraw all the time whenever I scroll in Chrome. I remove the jquery and it goes back to working as expected. Anyone else found this issue before?

Scrolling content

Hi there, excellent work on the slider btw.

I saw it mentioned that there is now support for "scrollable content" in Superslides 0.4.1. http://nicinabox.com/blog/superslides-0-dot-4-1-released/. How does this get applied?. My issues is i have a text box that is part of one of the slides that it taller than the browser window but currently i have no ability to scroll this should it be cut off by the browser window height. Can this be implemented via Superslides or is the mention of "scrollable content" relevant to something else entirely?

Many thanks in advance.

Firefox 14.0.1 on Windows 7

Hello, any advice on Firefox compatibility? I'm testing in Firefox 14.0.1 on Windows 7 and I can't get any of the slide content to show, just the navigation buttons. I have the same problem trying to access the demo site (http://nicinabox.github.com/superslides/). Any ideas? It works fine in Chrome and IE.

min-width site issue when using superslides

Hi there,

I need to set a minimum width for my website. i.e. 960px but superslides seems to prevent this behaviour. The min-width should present a horizontal scrollbar once the viewport is less that 960px but when using superslides the horizontal scrollbar is never shown and content becomes clipped without the ability to scroll. Is there a method for setting a minimum width with superslides that will not break this behaviour?

Many thanks in advance.

0.5 Getting current slide & number of slides

Hi there,

I need to be able to log the current slide ref and also be able to get the total number of slides. I had this working in the previous version but this logic now seems out of date with 0.5. Could you advise how i can acheive this with 0.5.

Many thanks in advance.

Single slide

I was just wondering if the fix for a single slide has been included in version 0.4.2. Currently, if i only have a single slide, this is completely hidden on page load. The content is output to html but visually i can't see anything. This relates to the closed issue #4.

Respect jQuery no-conflict mode

The code currently has no respect for jQuery no conflict mode. It'd be nice to wrap the entire plugin with the $ alias sent in as a parameter.

Destroy and build method

Another suggestion : for ajax calls and replacing content in the slider, why not add two methods? A destroy function to remove the slides and stop the slider, another one to rebuild it. It would be great.

issue with safari flicker fix

v0.4.3 fixes the safari flicker issue, but now I have the issue that any sliders that are loaded are hidden until highlighted. I don't know if this is an issue specifically with my code as I am using slider elements with 0.6 opacity.

Removed the following line and it seems to work fine...

#slides .slides-container img {
  -webkit-backface-visibility: hidden;
}

trying to write a custom function using superslides event

im trying to write a simple custom function using superslides event. javascript isn't my strong suite. I do understand the logic though. basically i just want to write something as simple as
if current slide = whatever then do something. problem is that when i use the API 'current' it always equals to -1. also i'm not sure how to use the event handlers. was hoping you can provide some sort of example.

cheers,
Dan

Touch slide

A small contribution with a touch or swipe enabled superslide with jquery.touchwipe.1.1.1.js !

Tested on Ipad 2 . Works like a charm. Hope to see something similar included in your next version

<script src="jquery.touchwipe.1.1.1.js"></script>

Code to add :

$("#slides").touchwipe({
wipeLeft: function() {
$('.next').trigger('click');
},
wipeRight: function() {
$('.prev').trigger('click');
},
min_move_x: 20,
min_move_y: 20,
preventDefaultEvents: true
});

Using with very large images

Hi,
I'm trying to use your library with very large images - slideshow of pictures directly from a camera. The result is that the images are not fitted to the screen but cropped at the original size.

What can I do to avoid that?

Thanks!

Page loaded by ajax, slider not showing

Hello !
First of all, thank you for this wonderful and simple plugin, i am very lucky to have stumbled upon it !

I am having an issue now, and i hope you could guide me or help me with it.

I have a completely ajaxed website. When i first load a page that contains the slider, it shows fine. Then when i move to another page, and come back, the slider does not show.

I inspected the css, and it seems that "display:none" is added to the list and container. I also tried to play around with the code, but i got lost. I saw a variable called "first_load", that might be the origin of my issue.

I tried the callback superslides.start, but it does not work. Is there a way to disable the "first_load" option or destroy the slider when the page changes ?

Regards

Mozilla and IE issues

There's a small issue I'm having. I've gotten the slider to work perfectly in Chrome.

I have text overlayed on top of the images on each slide. In Firefox, when you hit the next button the text is slightly delayed in showing up. Not a huge problem, but I'd like it if the text arrived together with the image like it does in Chrome.

Also, in IE when the next button is hit, the text from the previous slide overlaps onto the text for the next slide for a couple seconds.

I've tried everything I can think of and nothing has fixed these two problems. If anyone could help it'd be very much appreciated.

Further images in panel content

I have an issue where if i use an additional image within the slide this gets picked up by Superslides too. Is there a method to only select the first image within any slide li? Currently all images get picked up including one deeper in the content. which should just be presented as normal rather than being picked up as a slide background.

Many thanks in advance.

Center images

Nice work!

I'm using landscape images, but when used on mobile devices such as tablets, if you change the device orientation from landscape to portrait the images are left-aligned so the important part of them are hidden. I've tried to change the css so that the images are "centered" but I've had no success. Can you tell me where I'm going wrong?

Thanks!

Stopping autoplay on last slide

Hey, is it possible to stop autoplay when the last slide is displayed, so it will just stay on without going back to the first slide again? Thanks!

min/max-width in ie

As you mentioned in the front page notes i see that ie7 & ie8 stop scaling the background image beyond a certain point when reducing the size of the browser window. You mentioned that you can remedy this with a polyfill. Do you know the polyfill or where this could be sourced from?

Many thanks in advance.

Second instance does not initialize

I have two superslides instances in a page (why two? the first one is the background of the page, the second one is a fullscreen gallery) and I detected this problem:

when I make the second call:

$('#slides').superslides({
play: false,
slide_easing: 'linear',
nav_class: 'slides-navigation',
container_class: 'slides-container',
pagination: false,
hashchange: true
});

the initialization never happens, because the event:

$('body').on('slides.initialized', '#slides', function () {....});

is never called, but worst is the superslides doesn't appear. The weird is that the animated event is fired.

The other superslides is $('#backslides') so I'm sure it's not called again in the same node.

flicker in chrome

Hi there,

I am getting a flicker happening in chrome when the slides finish their transition from one to another. Now it doesn't happen 100% of the time but it does happen quite frequently. I cant seem to mimic the problem in any other browser.

By the way I am using a Mac OS X 10.6 with chrome.

Thanks

asynchronization between sliding anaimation and change of active bullet of pagination

hi, thanks for this great plugin. i only have one problem with it.
the sliding animation goes complete before the corresponding bullet in the pagination becomes active also, the 'slides.animated' event is fired very far away from the start of the sliding animation. meaning that the event is fired after the animation is done. i need it to be fired once the animation is started.

Opera browser issues

Hi There,

I have noticed that the demo (http://nicinabox.github.com/superslides/) doesn't function at all in the Opera browser. I get the previous & next buttons but just a white screen with the images or content not showing. Is there any way to fix this?

Regards

Brendan Randall

First slide is visible after animation

Hi. After update to 0.5, the first slide is always visible. So if you have semi-transparent backgrounds (or just content w/o background image) you'll see the first slide content.

P.S. there was no such problem in 0.4.3

Autoplay feature

Hi,

There is a play:true setting, and that works. But I would like to have a delay-setting. So that the slide keeps still XX seconds before moving on.

I have been digging through the code, but this does seem to be absent.
Is there a way to do this?

Martin

Last slide event

Hi,

This is more of a question and not an issue.
Is there any way I can get an event when the last slide ends , something like 'afterEnd' or 'beforeStart' ?

or, can I get the current running slide number ?

Vimeo

I added Vimeo video to the slider. ( 1 minut long ) and I have problem.

Video have autoplay. But when I change slide to another the video do not stop and play on.

So, when I am on another slide, only with image I hear music from the video.

The FlexSlider (http://flexslider.woothemes.com/video.html) have API which is working like I would like. Any ideas?

tabbed or browsing through the slides

HI,

Great slider ..!

i was just wondering how to add a navigation menu or tabs to browse through the slides and provide a url for each one of them that can de triggered at pageload.

something like
example.com/#1
example.com/#2
...

var startSlide = 0

if (location.hash == "#1") {
startSlide = 1;
}
if (location.hash == "#2") {
startSlide = 2;
}
if (location.hash == "#3") {
startSlide = 3;
}
if (location.hash == "#4") {
startSlide = 4;
}
if (location.hash == "#5") {
startSlide = 5;
}
if (location.hash == "#6") {
startSlide = 6;
}
if (location.hash == "#7") {
startSlide = 7;

    }

Thanks

Opera browser issues still with v0.5.1

Hi There,

I've been having a look through v0.5.1 and it looks great. However, i know you mentioned that v5 was was working in Opera when i raised the issue for v4 but i can't seem to get this to function. Even the demo doesn't function in Opera - it just presents a white screen, with arrow but no images. Details of my Opera set-up are below:

Version: 12.50 internal
Build: 1497
Platform: Win32
System: Windows 7

Cheers

Define an option if we have just one slide

Hello!

I tried yesterday to make a script detecting if the slider has 1 or more slides to run some or some function... I loss several hours to get absolutely nothing... and I finally found this variable in your script code :

size = $children.length;

Why not create another parameter to set if yes or not we run the slider when we have just one slide ?!?

Juste like that.

    start = function() {
      if (size > 1){ // Check if more than 1 slide
         animate((first_load ? 0 : "next"));
         return play();
      }
    };

It works very well and it offers the possibility of an adaptive slider, so, why don't implement it ? :)

Link to specific tab

Hi, is it currently possible to navigate to a specific tab in the slider using an external navigator? Cheers.

crop slider dimensions

Is it possible to create a set height for the slider? Preferably in the 800-850pixel range? Just want to see if it's possible.

Any way to add a fade effect?

Love the full screen image size and performance of this slider...I just need it to fade to the next slide

Any way to add a fade effect? I know both the easing and animate plugins support it, just not sure how to incorporate it in superslides. I am not super experienced with jQuery but if you outline the basics of how it could be done...I should be able to get there ; )

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.