(function($){ $(function() { var images = $("img"); for(var i=0; i < images.size(); i++) { //_on,_off画像切り替え型ロールオーバー if(images.eq(i).attr("src").match("_off.") && (!images.eq(i).hasClass("current") && !images.eq(i).hasClass("noRollOver"))) { $("img").eq(i).hover(function() { $(this).attr('src', $(this).attr("src").replace("_off.", "_on.")); }, function() { $(this).attr('src', $(this).attr("src").replace("_on.", "_off.")); }); } } $(window).on("load",function(){ $("a[href^=#]").unbind("click"); $("a[href^=#]").click(function(e) { e.preventDefault(); // アンカースクロール var speed = 400; // ミリ秒 var href= $(this).attr("href"); var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top - $("#header-bottom").height(); $('body,html').animate({scrollTop:position}, speed, 'swing'); }); }); }); })(jQuery);