I have a container with three divs of content inside of it. I am using javascript to navigate from left to right across the divs with the navigation tools referenced as an unordered list. Instead I would like to make those divs fixed and just move the entire container from left to right using the same navigation buttons.
Here is the javascript I tried. In order for this to work, I tried to change var $anchor = $(this) to var $anchor = $(the name of the container div), but that doesn't work. Could someone help me out with this? Thanks
<script type="text/javascript">
$(function() {
$('ul.nav a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollLeft: $($anchor.attr('href')).offset().left
}, 1000);
event.preventDefault();
});
});
</script>