jQuery(function(){
   jQuery('a[href^="#"]').click(function() {
      var speed = 700;
      var href= jQuery(this).attr("href");
      // 移動先を取得
      var target = jQuery(href == "#" || href == "" ? 'html' : href);
      var position = target.offset().top;
      // スムーススクロール
      jQuery('body,html').animate({scrollTop:position}, speed, 'swing');
      return false;
   });
});

jQuery(function(){
  var tscroll = jQuery('.pagetop');
  tscroll.hide();
  jQuery(window).scroll(function () {
     if (jQuery(this).scrollTop() > 100) {
          tscroll.fadeIn();
     } else {
          tscroll.fadeOut();
     }
  });
  tscroll.click(function () {
     jQuery('body, html').animate({ scrollTop: 0 }, 500);
     return false;
  });
});

(function($) {
    $(function () {
      $('#nav-toggle').on('click', function() {
        $('body').toggleClass('open');
      });
    });
})(jQuery);


jQuery(window).scroll(function(){
  if (jQuery(window).scrollTop() > 50) {
    jQuery('.header').addClass('active');
  } else {
    jQuery('.header').removeClass('active');
  }
});

(function($) {
  $(function () {
    $('#menu-item-553').on('click', function() {
      $('body').toggleClass('dropdownopen');
    });
  });
})(jQuery);