View Single Post
Old 09-22-2012, 10:24 PM   PM User | #12
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 454 Times in 452 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
the code in post #9 gives 0 for 0 pages and 149 for 1, 199 for 2, etc. Post 10 was just playing around. You could even take it further, and not worry where the minimum value starts...

Code:
var prices={40:34,80:99,120:862,160:10482}; 

...

$( "#amount" ).val( "£" + prices[ui.value] );
xelawho is offline   Reply With Quote