Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- // ancres douces
- $('a').on('click',function(){
- let cible = $(this).attr('#hautpage');
- if(cible.substr(0,1) == '#'){
- $('html,body')
- .stop()
- .animate({scrollTop : $(cible).offset().top - 80 },700);
- }
- });
- let hauteurDocument = $(document).height();
- let indicateur=false;
- $(window).scroll(function(){
- if ( $(window).scrollTop() > 60 ){
- $('#remonte').show();
- }else{
- $('#remonte').hide();
- }
- hauteurScroll = $(window).scrollTop();
- hauteurFenetre = $(window).height();
- pourcentageParcouru = hauteurScroll * 100 / (hauteurDocument - hauteurFenetre);
- if (pourcentageParcouru > 50 && indicateur === false ){
- $('main,header,footer').fadeTo(500,0.3);
- $('#message').slideDown(500);
- indicateur = true;
- }
- });
- $('#close').on('click',function(e){
- e.preventDefault();
- $('main,header,footer').fadeTo(500,1);
- $('#message').slideUp(500);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement