Why isn't this jQuery image switcher working?
I have a main image, with circular divs below. I would like to change the
main image when one of these divs is clicked, with it's containing image.
This is proving more challenging than I thought. Sorry if this is 'help
vampire-y', but I don't know what else to try.
<div class="span6 slider">
<img src="img/food-and-drink/taps.jpg" alt="Photograph of beer
taps">
<div class="row-fluid">
<div class="span12">
<a href="#"><div class="slider-circle"><img
src="img/food-and-drink/kegs.jpg" alt="Photograph of
kegs"></div></a>
<a href="#"><div class="slider-circle"></div></a>
<a href="#"><div class="slider-circle"></div></a>
</div>
</div>
</div>
Jquery
var currentSlide = $('.slider img').attr('src');
$('.slider-circle').click(function() {
$currentSlide = $(this).child().attr('src');
})
No comments:
Post a Comment