[JavaScript] jQuery 平滑滚动页面到指定锚标记 →→→→→进入此内容的聊天室

来自 , 2021-04-20, 写在 JavaScript, 查看 144 次.
URL http://www.code666.cn/view/735143e9
  1. var JQUERY4U = {}
  2. JQUERY4U.UTIL =
  3. {
  4.         /*
  5.         *   Utility function used to make anchor links animate smoothly instead of jumping.
  6.         */
  7. smoothAnchor:
  8.         function ( anchorClass )
  9.         {
  10.                 $ ( 'a.'+anchorClass ).click ( function ()
  11.                 {
  12.                         elementClick = $ ( this ).attr ( "href" )
  13.                         destination = $ ( elementClick ).offset().top;
  14. $ ( "html:not(:animated),body:not(:animated)" ).animate ( { scrollTop: destination}, 1100 );
  15.                         return false;
  16.                 } )
  17.         }
  18. }
  19.  

回复 "jQuery 平滑滚动页面到指定锚标记"

这儿你可以回复上面这条便签

captcha