Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If no options set, JS error #300 #319

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions responsiveslides.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"namespace": "rslides", // String: change the default namespace used
"before": $.noop, // Function: Before callback
"after": $.noop // Function: After callback
}, options);
}, options || {});

return this.each(function () {

Expand Down Expand Up @@ -68,8 +68,8 @@
$pager = $("<ul class='" + namespace + "_tabs " + namespaceIdx + "_tabs' />"),

// Styles for visible and hidden slides
visible = {"float": "left", "position": "relative", "opacity": 1, "zIndex": 2},
hidden = {"float": "none", "position": "absolute", "opacity": 0, "zIndex": 1},
visible = {"float": "left", "position": "relative", "opacity": 1, "zIndex": 1},
hidden = {"float": "none", "position": "absolute", "opacity": 0, "zIndex": ""},

// Detect transition support
supportsTransitions = (function () {
Expand Down Expand Up @@ -144,7 +144,7 @@

// Add max-width and classes
$this.addClass(namespace + " " + namespaceIdx);
if (options && options.maxwidth) {
if (settings.maxwidth) {
$this.css("max-width", maxw);
}

Expand Down Expand Up @@ -191,7 +191,7 @@
$pager.append(tabMarkup);

// Inject pager
if (options.navContainer) {
if (settings.navContainer) {
$(settings.navContainer).append($pager);
} else {
$this.after($pager);
Expand All @@ -206,14 +206,14 @@

// Add pager slide class prefixes
if (settings.pager || settings.manualControls) {
$pager.find('li').each(function (i) {
$pager.find("li").each(function(i) {
$(this).addClass(slideClassPrefix + (i + 1));
});
}

// If we have a pager, we need to set up the selectTab function
if (settings.pager || settings.manualControls) {
$tabs = $pager.find('a');
$tabs = $pager.find("a");

// Select pager item
selectTab = function (idx) {
Expand Down Expand Up @@ -281,7 +281,7 @@
var idx = $tabs.index(this);

// Break if element is already active or currently animated
if (index === idx || $("." + visibleClass).queue('fx').length) {
if (index === idx || $("." + visibleClass).queue("fx").length) {
return;
}

Expand Down Expand Up @@ -312,7 +312,7 @@
"<a href='#' class='" + navClass + " next'>" + settings.nextText + "</a>";

// Inject navigation
if (options.navContainer) {
if (settings.navContainer) {
$(settings.navContainer).append(navMarkup);
} else {
$this.after(navMarkup);
Expand All @@ -328,7 +328,7 @@
var $visibleClass = $("." + visibleClass);

// Prevent clicking if currently animated
if ($visibleClass.queue('fx').length) {
if ($visibleClass.queue("fx").length) {
return;
}

Expand Down Expand Up @@ -370,8 +370,8 @@
}

// Max-width fallback
if (typeof document.body.style.maxWidth === "undefined" && options.maxwidth) {
var widthSupport = function () {
if (typeof document.body.style.maxWidth === "undefined" && settings.maxwidth) {
var widthSupport = function() {
$this.css("width", "100%");
if ($this.width() > maxw) {
$this.css("width", maxw);
Expand Down