I'm using .slideToggle to show/hide content when an image is clicked, it changes once when the content shows but doesn't change back to the original image when its clicked again to hide the content, not quite sure what I'm missing here. Any help much appreciated.
the jQuery:
$(document).ready(function() {
$('#toggle1').click(function() {
$('.toggle1').slideToggle('1100');
$("#bg").attr('src',"images/box-arrow-down.jpg");
return false;
});
the HTML:
<div class="box">
<div style="width:1100px;height:100px;margin-left:40px;">
<span style="float:left;"><a href="#" id="toggle1"><img src="images/box-arrow-up.jpg" height="16" width="17" alt="arrow" id="bg" style="margin-top:40px;" /></a></span>
</div>
<div class="toggle1" style="display:none;width:1100px;padding:0px;margin-left:8px;">
<div class="boxTime">09:00</div>
</div>
</div>