pskl
30 Oct 2010, 06:56 AM
Hi !
I'm still working on my gallery, and after a few hours of coding it's finally ready.
Just a little bug I'd like to correct, but I don't know how !
On psaikali.com, there's is a 'galeria' in the middle of the page. When the user clicks on the left/right arrow, it slides to show other artworks. So far, it's working.
The only thing I'd like to fix is when you click twice (or more) on the arrow, the sliding effect will happen twice.
But in my script, there are some conditionals existing to determine how long the sliding effect should be, depending on the number of artworks left to see. On a double click, these conditionals happen just once, so the expected result is destroyed
I'd like to know if there is some kind of jQuery (or javascript) code to put in my onclick function to tell : 'wait before the animation is finished, then do what you have to do'.
By the way, here is the line of my code doing the animation :
$("#galeria-slider").animate({ marginLeft:"+=1000px"}, 800 );
I hope I'm clear enough ! If some developpers around there have a trick to avoid this, it would be great !
Tchau.
Pierre
I'm still working on my gallery, and after a few hours of coding it's finally ready.
Just a little bug I'd like to correct, but I don't know how !
On psaikali.com, there's is a 'galeria' in the middle of the page. When the user clicks on the left/right arrow, it slides to show other artworks. So far, it's working.
The only thing I'd like to fix is when you click twice (or more) on the arrow, the sliding effect will happen twice.
But in my script, there are some conditionals existing to determine how long the sliding effect should be, depending on the number of artworks left to see. On a double click, these conditionals happen just once, so the expected result is destroyed
I'd like to know if there is some kind of jQuery (or javascript) code to put in my onclick function to tell : 'wait before the animation is finished, then do what you have to do'.
By the way, here is the line of my code doing the animation :
$("#galeria-slider").animate({ marginLeft:"+=1000px"}, 800 );
I hope I'm clear enough ! If some developpers around there have a trick to avoid this, it would be great !
Tchau.
Pierre