kswedberg / jquery-carousel-lite

A jQuery carousel plugin based on jCarouselLite by Ganeshji Marwaha
MIT License
177 stars 59 forks source link

issue with random number and circular #16

Closed twuncher closed 12 years ago

twuncher commented 12 years ago

Hi,

i have initialised a carousel to have a random start number, so its not showing the same content each page load. I have 25 sets of 2 list items (text + image) to display.

my issue is that when it gets to end of the the carousel instead of just carry on cycling through, after the second list item it jumps back from the 2nd list item to 24th item without fail and gets caught in a loop of cycling to the 2nd list item then jumping back to the 24th.

the strange thing is if i start with a non random start number (eg.4) it works with out fail....

below is my code.

$(function() { var TOTAL_ITEMS = 25; var randNum = Math.floor(Math.random()(TOTAL_ITEMS+1)); randNum = randNum \ 2; $(".carousel").jCarouselLite({ btnNext: ".next", btnPrev: ".prev", auto:true, speed:2000, timeout:6000, direction:true, start: randNum, hoverpause:true, visible:2, scroll:2

});

});

thanks for any assistance

Tom

twuncher commented 12 years ago

scrap this, i update from 1.64 to 1.71 and it seems to be resolved.

kswedberg commented 12 years ago

Ah, good to know. Not sure why that would have fixed it, but I appreciate your taking the time to inform me!

twuncher commented 12 years ago

Yeah I'm not sure either. Strange! Thanks for the continuation of a great script!

Regards

Tom Sent using BlackBerry® from Orange

-----Original Message----- From: Karl Swedberg reply@reply.github.com Date: Thu, 3 May 2012 13:34:31 To: twuncher@hotmail.com Subject: Re: [jquery-carousel-lite] issue with random number and circular (#16)

Ah, good to know. Not sure why that would have fixed it, but I appreciate your taking the time to inform me!


Reply to this email directly or view it on GitHub: https://github.com/kswedberg/jquery-carousel-lite/issues/16#issuecomment-5487561