I have a JQuery carousel with four images stored in a file called carousel.php. I also have a gallery.php file where are the four images in a list as hyperlinks. When I click on them I get their "id"
<li><a href='carousel.php?id=1'><img src=1.jpg'></a></li>
<li><a href='carousel.php?id=2'><img src=2.jpg'></a></li>
<li><a href='carousel.php?id=3'><img src=3.jpg'></a></li>
<li><a href='carousel.php?id=4'><img src=4.jpg'></a></li>
at the gallery.php through $id=$_GET['id'] and then I create a javascript variable of this id called $imgvar.
var $imgvar = "<?php echo $id; ?>";
So, I want the carousel to display first the image which was clicked by the user and then continue the normal order. (e.g. if I click 3.jpg, the carousel starts displaying 3.jpg and then I click the "right navigation arrow" goes to 4.jpg or if I click the "left navigation arrow" goes to 2.jpg etc).
I guess I need a IF else statments to compare the id with each image and make "active" the one which was hyperlinked, but I can't find the right way. Anybody who might help?
Thanks for your time.