Not sure how to word this. I currently have a script that I would like to be more dynamic…
if(endpos < 7){
$('#div').tinycarousel({start:1});
}else if(endpos>6 && endpos<13){
$('#div').tinycarousel({start:2});
}else if(endpos>12 && endpos<19){
$('#div').tinycarousel({start:3});
}else if(endpos>18 && endpos<25){
$('#div').tinycarousel({start:4});
}else{
$('#div').tinycarousel({start:5});
}
So this works for me now, but what if endpos = 150, I am stuck with start:5. I could keep writing the scales so they went to 1000, but it doesn’t make any sense to do that. I am sure there is a way to write it one time so that the number for “start” increases by 1 for each section of 6 that “endpos” increases.
ceil will take let’s say .5 and make it the next highest whole number, 1 in this case.