Place soft or slow effect on anchor (window.location.href)

Asked

Viewed 348 times

1

I have the following code:

if($('#otherfilter').is(':visible')){
  window.location.href='#otherfilter';
}

I would like to put a certain slowness for him to accomplish this anchor.

  • had already seen, but I could not implement in my code no :/

1 answer

-1

$(function() {
                $('a').bind('click',function(event){
                    var $anchor = $(this);

                  $('html, body').stop().animate({scrollTop: $($anchor.attr('href')).offset().top}, 1000,'easeInOutExpo');

            // Outras Animações
            // linear, swing, jswing, easeInQuad, easeInCubic, easeInQuart, easeInQuint, easeInSine, easeInExpo, easeInCirc, easeInElastic, easeInBack, easeInBounce, easeOutQuad, easeOutCubic, easeOutQuart, easeOutQuint, easeOutSine, easeOutExpo, easeOutCirc, easeOutElastic, easeOutBack, easeOutBounce, easeInOutQuad, easeInOutCubic, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInOutExpo, easeInOutCirc, easeInOutElastic, easeInOutBack, easeInOutBounce


                });
            });

For html you can follow this structure, link with the hashtag and id in the session wherever the page slides

Browser other questions tagged

You are not signed in. Login or sign up in order to post.