Forum Moderators: open

Message Too Old, No Replies

Jquery plugin, code doesn't work

but only the first time round

         

Tommybs

12:32 pm on Oct 2, 2009 (gmt 0)

10+ Year Member



Hi all,

I've been building a jquery plugin that acts as a carousel for a single image as a way to learn more about plugin development.

It has previous and next buttons that are designed to loop through as well as a window.setInterval to scroll automatically to begin with.

now the first time I try to scroll through, the previous button takes you to the 'next' item and not the previous item and the next button doesn't animate properly (though it does use the correct order).

Once It's gone through the sequence once however (even though the correct images aren't display, but in terms of numbers), everything seems to work fine. I'm totally stumped as to why this is happening. Does anyone have any clues? Are there any kind of initialize functions or setup functions I need to call first?

I've tried this with a number of the button click events removed and I still get the same issue.

daveVk

2:03 pm on Oct 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check initial css settings, the images for example may need to be display none or whatever the animation property is, initialized correctly.

Tommybs

2:29 pm on Oct 2, 2009 (gmt 0)

10+ Year Member



Do'h, that was it. Thank you