Pages

Monday 2 February 2015

Magento:: Scroll To Top functionality

Scroll To Top functionality in Magento
Open your header.phtml file and write below code..
<a title="Scroll To Top" class="scrollup" href="javascript:void(0);" style="display: none;">Scroll</a>
<script type="text/javascript">
jQuery(document).scroll(function(){
if (jQuery(this).scrollTop() > 100) {
jQuery('.scrollup').fadeIn();
} else {
jQuery('.scrollup').fadeOut();
}
});
jQuery('.scrollup').click(function(){
jQuery("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
</script>

2 comments:

  1. I’m not that much of a online reader to be honest but your sites really nice, keep it up! I'll go ahead and bookmark your site to come back later on. All the best

    ReplyDelete
  2. This is my first time go to see at here and i am actually pleassant to read all at alone place.

    ReplyDelete