jQuery(function() { jQuery("a[href^=#]").click(function(){ var elmID = jQuery(this).attr("href"); var posi = 0; if(jQuery(elmID).size()){ posi = jQuery(elmID).offset().top -0; BodySlider(posi); return false; } }); function BodySlider(HashOffset){ jQuery("html,body").animate({ scrollTop: HashOffset }, 600); } }); /*============================================== 要素の高さを揃える ==============================================*/ $(function(){ $('.STF_WEBNAME').matchHeight(); }); /*============================================== スクロールで表示/非表示 ==============================================*/ $(function() { var topBtn = $('.bt_pagetop'); topBtn.hide(); //スクロールが100に達したらボタン表示 $(window).scroll(function () { if ($(this).scrollTop() > 100) { //ボタンの表示方法 topBtn.fadeIn(); } else { //ボタンの非表示方法 topBtn.fadeOut(); } }); //スクロールしてトップ topBtn.click(function () { $('body, html').animate({ scrollTop: 0 }, 500); return false; }); });