Friday 1 May 2015

Parallax Scroll and Back to Top Using Jquery

Parallax Scroll and Back to Top Using Jquery


Hello
Here you can create parallax scroll and back to top using jquery.

just you can add jquery in your html 


i am write script here give smaple code then check it your html

here sample code


please check it 

here i  add simple jquery scripy

<script type="text/javascript"&
gt;

jQu
ery( document ).ready(function() {
    
    jQuery('.tryitbtn a').click(function() { 
     if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
    
    jQuery('a.back_t').click(function () {
        //alert('hi');
jQuery('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
  
})
;

</
script>

No comments:

Post a Comment

Thank You For Comment