Welcome to designer dairy blog, here we are going to discuss how to scroll up the page using jquery .
Step1:
In my scenario, I have the fixed header and the content area consists of the anchor tag link.when the user clicks the link it should be moved to appropriate section .
Step2:
Script:
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script >
$( function( ) {
$('a[hre f^=" #"]'). not('[ href=# ]').click (f unct ion(e){
var anchorTag=$(this).attr('href').replace('.' ,'\\.');
$('htm l, body' ).animate({scr ollTop: $ (a nchorTa g) .offset() .t op - ($(' .se archbar').o u t erHei ght()+5) }, 10 00);
return false
;
}
);
Step3:
Thanks for readingm y article .Stay Tune on www.webdesignersdairy.com for more updates on Jquery.
Step1:
In my scenario, I have the fixed header and the content area consists of the anchor tag link.
Step2:
Script:
<
<
$
$('a[hr
var anchorTag=$(this).attr('href').replace('.
$('ht
return false
;
}
);
Step3:
Thanks for reading
No comments:
Post a Comment