I have thumbnails on a page, as such:
<div id="credits">
<a href="largeimage1.jpg" alt="credits1.php"><img src="thumb1"></a>
<a href="largeimage2.jpg" alt="credits2.php"><img src="thumb2"></a>
<a href="largeimage3.jpg" alt="credits3.php"><img src="thumb3"></a>
</div>
<div id="zoom"></div>
<div id="credits"></div>
I'm looking to do the following:
- user clicks thumb1 > largeimage1 loads in #zoom AND credits1.php loads in #credits
- user clicks thumb2 > largeimage2 loads in #zoom AND credits2.php loads in #credits
- etc.
Is this possible with jquery? ie. is it possible to make TWO (2) ajax calls on the same page with one click as in above?
I currently have the following code working for the LARGE image ajax call:
<script type="text/javascript">
$(document).ready(function(){
$("a").click(function(){
var largePath = $(this).attr("href");
$("#zoom img").fadeOut("slow", function() {
$(this).attr({ src: largePath }).fadeIn("slow");
});
return false;
});
});
</script>
and it works like a charm - but I now have a situation where I'd like to load up credits for the images in another div.
Any help is greatly appreciated. :)