Posts: 1,037
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
It it easier to use one of these plugins to accomplish what you are trying to do: http://www.gmarwaha.com/jquery/jcarousellite/index.php http://malsup.com/jquery/cycle/
***EDIT***
BTW, I think you misunderstand the .next() function.
When you do this:
Code:
$("div#slideshow").next("div.slide_image")
What you are doing is selecting the next sibling to div#slideshow that has a class of 'slide_image'. This doesn't work because the elements with that class are all children of #slideshow.
To select a certain child, you could do something like this:
Code:
$("div#slideshow .slide_image:nth-child(1)").fadeIn(400);
Then replace the (1) with a variable that increments or the reverse depending on which button is pushed. However, the plugins are still easier...
***EDIT AGAIN***
Oh, and I might point out, that with the above method you will have to restart the order when you reach the maximum length of the $("div#slideshow .slide_image) array, which means that you must evaluate the incrementing variable against $("div#slideshow .slide_image").length;
Last edited by wayfarer07 : 07-08-2008 at 10:07 PM.
|