I would like to add the scroll effect to my page, so that when I click on a menu link, it would go down a page to where it needs to. I have set it up so that when I click on a link it will go to the desired div, but when I tried adding a jquery code to index.php file nothing happens.
I'm using yougrids template and Joomla 3.2.
the div id is yjsg5 so I put in my menu link external link that links to #yjsg5. It works since when I click it it goes to that part of the page.
Now in my index.php I added this piece of code:
<script type="text/javascript">
var $root = $('html, body');
$('#yjsg5').click(function() {
var href = $.attr(this, 'href');
$root.animate({
scrollTop: $(href).offset().top
}, 2000, function () {
window.location.hash = href;
});
return false;
});
</script>
at the end of the <body> tag. But that's not working. I've read that they changed something in Joomla 3 with jquery so this may be the reason why it's not working.
Any help would be appreciated :)