Browse Source

Charlie Hawker Fix for issue #299

pull/319/head
Ridge 10 years ago
parent
commit
a8daea4223
  1. 22
      responsiveslides.js

22
responsiveslides.js

@ -29,7 +29,7 @@
"namespace": "rslides", // String: change the default namespace used "namespace": "rslides", // String: change the default namespace used
"before": $.noop, // Function: Before callback "before": $.noop, // Function: Before callback
"after": $.noop // Function: After callback "after": $.noop // Function: After callback
}, options); }, options || {});
return this.each(function () { return this.each(function () {
@ -68,8 +68,8 @@
$pager = $("<ul class='" + namespace + "_tabs " + namespaceIdx + "_tabs' />"), $pager = $("<ul class='" + namespace + "_tabs " + namespaceIdx + "_tabs' />"),
// Styles for visible and hidden slides // Styles for visible and hidden slides
visible = {"float": "left", "position": "relative", "opacity": 1, "zIndex": 2}, visible = {"float": "left", "position": "relative", "opacity": 1, "zIndex": 1},
hidden = {"float": "none", "position": "absolute", "opacity": 0, "zIndex": 1}, hidden = {"float": "none", "position": "absolute", "opacity": 0, "zIndex": ""},
// Detect transition support // Detect transition support
supportsTransitions = (function () { supportsTransitions = (function () {
@ -144,7 +144,7 @@
// Add max-width and classes // Add max-width and classes
$this.addClass(namespace + " " + namespaceIdx); $this.addClass(namespace + " " + namespaceIdx);
if (options && options.maxwidth) { if (settings.maxwidth) {
$this.css("max-width", maxw); $this.css("max-width", maxw);
} }
@ -191,7 +191,7 @@
$pager.append(tabMarkup); $pager.append(tabMarkup);
// Inject pager // Inject pager
if (options.navContainer) { if (settings.navContainer) {
$(settings.navContainer).append($pager); $(settings.navContainer).append($pager);
} else { } else {
$this.after($pager); $this.after($pager);
@ -206,14 +206,14 @@
// Add pager slide class prefixes // Add pager slide class prefixes
if (settings.pager || settings.manualControls) { if (settings.pager || settings.manualControls) {
$pager.find('li').each(function (i) { $pager.find("li").each(function(i) {
$(this).addClass(slideClassPrefix + (i + 1)); $(this).addClass(slideClassPrefix + (i + 1));
}); });
} }
// If we have a pager, we need to set up the selectTab function // If we have a pager, we need to set up the selectTab function
if (settings.pager || settings.manualControls) { if (settings.pager || settings.manualControls) {
$tabs = $pager.find('a'); $tabs = $pager.find("a");
// Select pager item // Select pager item
selectTab = function (idx) { selectTab = function (idx) {
@ -281,7 +281,7 @@
var idx = $tabs.index(this); var idx = $tabs.index(this);
// Break if element is already active or currently animated // Break if element is already active or currently animated
if (index === idx || $("." + visibleClass).queue('fx').length) { if (index === idx || $("." + visibleClass).queue("fx").length) {
return; return;
} }
@ -312,7 +312,7 @@
"<a href='#' class='" + navClass + " next'>" + settings.nextText + "</a>"; "<a href='#' class='" + navClass + " next'>" + settings.nextText + "</a>";
// Inject navigation // Inject navigation
if (options.navContainer) { if (settings.navContainer) {
$(settings.navContainer).append(navMarkup); $(settings.navContainer).append(navMarkup);
} else { } else {
$this.after(navMarkup); $this.after(navMarkup);
@ -328,7 +328,7 @@
var $visibleClass = $("." + visibleClass); var $visibleClass = $("." + visibleClass);
// Prevent clicking if currently animated // Prevent clicking if currently animated
if ($visibleClass.queue('fx').length) { if ($visibleClass.queue("fx").length) {
return; return;
} }
@ -370,7 +370,7 @@
} }
// Max-width fallback // Max-width fallback
if (typeof document.body.style.maxWidth === "undefined" && options.maxwidth) { if (typeof document.body.style.maxWidth === "undefined" && settings.maxwidth) {
var widthSupport = function() { var widthSupport = function() {
$this.css("width", "100%"); $this.css("width", "100%");
if ($this.width() > maxw) { if ($this.width() > maxw) {

Loading…
Cancel
Save