Scrolling Issue
Scrolling Issue
Hey. I've got a tiny problem which I can't seem to figure out, I might be missing something very simple, or just not doing it the best way..
Anywho,
Here's the deal, I've got lots of img thumbs, when you click it it toggles to big one and scrolls to the top of that image.., but sometimes I get an irregular behaviour, for instance, when I click the thumb the big image doesn't show and the document scrolls to the top..
Here's the code i'm using..
<script type="text/javascript">
$(function(){
$(".small").click(function() {
$(this).hide();
$(this).next(".big").show();
$.scrollTo($(this).next(".big"), 800);
$(".big").click(function(){
$(this).hide();
$(this).prev(".small").show();
});
});
});
</script>
<img class="small" src="thumb1.jpg" width="150" height="100"/>
<img class="big" src="big1" width="800" height="600" />
Any ideas?