Browse Source

Changing classes

pull/21/head
Viljami S 13 years ago
parent
commit
1217c98be0
  1. 23
      responsiveslides.js

23
responsiveslides.js

@ -1,4 +1,4 @@
/*! http://responsive-slides.viljamis.com v1.10 by @viljamis */ /*! http://responsive-slides.viljamis.com v1.20 by @viljamis */
(function ($, window, i) { (function ($, window, i) {
$.fn.responsiveSlides = function (options) { $.fn.responsiveSlides = function (options) {
@ -73,9 +73,7 @@
.css("max-width", settings.maxwidth) .css("max-width", settings.maxwidth)
.addClass(namespaceIndexClass); .addClass(namespaceIndexClass);
// Hide all slides, then show first one + add visible // Hide all slides, then show first one + add visible class
// class for that one. Later we are using that same
// class to check if it's currently :animated
$slide $slide
.hide() .hide()
.eq(0) .eq(0)
@ -120,8 +118,7 @@
rotate = setInterval(function () { rotate = setInterval(function () {
var idx = index + 1 < length ? index + 1 : 0; var idx = index + 1 < length ? index + 1 : 0;
// Only remove active state from old tab and set // Remove active state and set new if pagination = "true"
// to new one if we have pagination set to "true"
if (settings.pagination === true) { if (settings.pagination === true) {
selectTab(idx); selectTab(idx);
} }
@ -159,9 +156,7 @@
return; return;
} }
// Prevent click/touch if currently animated, // Prevent click/touch if currently animated
// otherwise if someone is using very long fade
// This'll break when changing a slide at the same time
if ($("." + visibleClass + ":animated").length) { if ($("." + visibleClass + ":animated").length) {
return false; return false;
} }
@ -184,16 +179,16 @@
if (settings.nav === true) { if (settings.nav === true) {
// Build markup // Build markup
var navMarkup = var navMarkup =
"<a href='#' class='" + namespaceIndex + "_nav_prev'>Prev</a>" + "<a href=\"#\" class=\"" + namespaceIndex + "_nav prev\">&laquo;</a>" +
"<a href='#' class='" + namespaceIndex + "_nav_next'>Next</a>"; "<a href=\"#\" class=\"" + namespaceIndex + "_nav next\">&raquo;</a>";
// Inject markup // Inject markup
$this.after(navMarkup); $this.after(navMarkup);
// Buttons // Buttons
var $prev = $("." + namespaceIndex + "_nav_prev"), var $prev = $("." + namespaceIndex + "_nav.prev"),
$next = $("." + namespaceIndex + "_nav_next"); $next = $("." + namespaceIndex + "_nav.next");
// Previous slide // Previous slide
$prev.bind("click", function (e) { $prev.bind("click", function (e) {

Loading…
Cancel
Save