ProLoser/AnythingSlider — Issue #253: Width and height not taken in account
Author: renard
Created: 2012-01-20 09:39:36+00:00
State: open

Here is a patch to handle both width and height during initialisation.

````
diff --git a/js/jquery.anythingslider.js b/js/jquery.anythingslider.js
index 045731b..608043d 100644
--- a/js/jquery.anythingslider.js
+++ b/js/jquery.anythingslider.js
@@ -61,8 +61,8 @@
base.currentPage = o.startPanel = parseInt(o.startPanel,10) || 1; // make sure this isn't a string
o.changeBy = parseInt(o.changeBy,10) || 1;
base.adj = (o.infiniteSlides) ? 0 : 1; // adjust page limits for infinite or limited modes
-	base.width = base.$el.width();
-	base.height = base.$el.height();
+	base.width = o.width || base.$el.width();
+	base.height = o.height || base.$el.height();
base.outerPad = [ base.$wrapper.innerWidth() - base.$wrapper.width(), base.$wrapper.innerHeight() - base.$wrapper.height() ];
if (o.playRtl) { base.$wrapper.addClass('rtl'); }

@@ -708,6 +708,9 @@
showMultiple : false, // Set this value to a number and it will show that many slides at once
easing : "swing", // Anything other than "linear" or "swing" requires the easing plugin or jQuery UI

+	width : false, // Default width in pixel
+	height : false, // Default height in pixel
+
buildArrows : true, // If true, builds the forwards and backwards buttons
buildNavigation : true, // If true, builds a list of anchor links to link to each panel
buildStartStop : true, // ** If true, builds the start/stop button
````