LoginSignup
4

More than 5 years have passed since last update.

ふわっとページ遷移メモ

Last updated at Posted at 2018-03-01

ページ遷移がふわっとする



//ページ遷移ふわっと
  $('head').append(
    '<style type="text/css">.is-hide{display:none;}</style>'
  );

  $(window).on("load",function() {
    $('body').fadeIn(800).removeClass("is-hide");
  });

  $(window).on("pageshow",function() {
    if (event.persisted) {
      window.location.reload();
    }
  });

  $(function(){
    $('a.fadelink').on("click",function() {
      var url = $(this).attr('href');
      if (url != '') {
        $('body').fadeOut(800);
        setTimeout(function(){
          location.href = url;
        }, 800);
      }
      return false;
    });
  });

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4