// JavaScript Document (function($){ $.fn.smoothScroll=function(op){ //デフォルトオプション var defaultOp={ target: 'html, body', //ターゲットノード duration: 600, //スピード easing: 'easeOutCubic' //イージング }; $.extend(defaultOp,op||{}); return this.each(function(){ //ターゲットポジション var t_pos=(defaultOp.target=='html, body')?0:$(defaultOp.target).position().top; $(this).hover(function(){ $(this).css('cursor','pointer'); },function(){ $(this).css('cursor','default'); }).click(function () { $('html, body').animate({ scrollTop:t_pos }, {duration:defaultOp.duration,easing:defaultOp.easing}); }); }); }; })(jQuery)