Nadine
Nadine

Reputation: 787

jQuery slider. Cannot pass a simple variable into the .slider function

I have the following

min = 1000;
jQuery('#slider').slider({
     range: "max",
     value: 9000,  
     min: 1000,    
     max: 1000000, 
     step: 500,    
});

All I want to do is simply pass the variable "min" into it. Whatever I have tried hasn't worked:

min = 1000;
jQuery('#slider').slider({
     range: "max",
     value: 9000,  
     min: min,    
     max: 1000000, 
     step: 500,    
 });

Any ideas?

Upvotes: 0

Views: 538

Answers (1)

Manse
Manse

Reputation: 38147

Here is a jsfiddle - http://jsfiddle.net/manseuk/b58Yd/

I have added var before your variable declaration and removed the final comma from the list of arguments ....

var min = 1000;
$('#slider').slider({range: "max",
     value: 9000,  
     min: min,    
     max: 1000000,
     step: 500

});

Upvotes: 1

Related Questions