jQuery实现平滑滚动页面到指定锚点链接的方法

时间:2015-07-15    点击:55   

本文实例讲述了jQuery实现平滑滚动页面到指定锚点链接的方法。分享给大家供大家参考。具体如下:

$.fn.scroller = function() {
  var speed = 'slow'; // Choose default speed
  $(this).each(function() {
    $(this).bind('click', function() {
      var target = $(this).attr('href'); // Get scroll target
      $(target).ScrollTo(speed);
      return false;
    });
  });
}

希望本文所述对大家的jquery程序设计有所帮助。

javascript数组排序汇总
javascript编写贪吃蛇游戏
Javascript显示和隐藏ul列表的方法
jQuery实现提示密码强度的代码
浅谈javascript中return语句
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved