views:

233

answers:

2

Hey guys, I have an image, when i hover on it i am able to view left and right arrows... when i click an arrow i am changing the source attr of the image using jquery... so i am successful in changing the images on clicking the arrows.. what i want is, how do i get the slide show feel... the animation pat where the current image slides right and a new image slides in from left when left arrow is clicked... please help me with this... i dont want to use the already existing plugins... Thanks in advance...

A: 

I would suggest that you use JQuery's animate features. Look at http://api.jquery.com/animate/ for more information.

uriDium
+2  A: 

To do this I would have two blocks, one for the old image and one for the new (both with overflow-hidden).

Starting positions:

  old - normal
  new - right margin = width of image

On animation tick e.g. every 0.05 secs

  old - left margin+1
  new right margin-1

Until the old has slid out and the new has slid in.

ck