随身笔记
随身笔记

jquery模仿淘宝首页侧边指定区域固定悬浮效果JQUERY SCROLL FOLLOW

OVERVIEW

Scroll Follow is a simple jQuery plugin that enables a DOM object to follow the page as the user scrolls. Scroll Follow has been successfully tested on IE6, IE7, FF2, FF3, Safari 3, and Opera 9 on Windows. It has been successfully tested on FF3 and Safari 3 on MacOSX.

REQUIREMENTS

OPTIONAL

INSTALLATION

  1. Include jQuery:
    1. <script type=”text/javascript” src=”jquery.js”></script>
  2. Include required plugins, including Scroll Follow:
    1. <script type=”text/javascript” src=”ui.core.js”></script>
    2. <script type=”text/javascript” src=”jquery.scrollFollow.js”></script>
  3. Call Scroll Follow on the desired DOM object:
    View Example

    1. <script type=”text/javascript”>
    2.   $( ‘#example’ ).scrollFollow();
    3. </script>
  4. Or call Scroll Follow on the desired DOM object and give it some parameters:
    View Example

    1. <script type=”text/javascript”>
    2.  $( document ).ready( function () {
    3.    $( ‘#example’ ).scrollFollow( {
    4.     speed: 1000,
    5.     offset: 60,
    6.     killSwitch: ‘exampleLink’,
    7.     onText: ‘Disable Follow’,
    8.     offText: ‘Enable Follow’
    9.    } );
    10.  } );
    11. </script>
  5. The Scroll Follow object will remain inside its immediate container.
    View Example
  6. Or you can specify a parent (by ID) for the Scroll Follow object to consider its container:
    View Example

    1. <script type=”text/javascript”>
    2.  $( document ).ready( function () {
    3.   $( ‘#example’ ).scrollFollow( {
    4.    container: ‘outer’
    5.   } );
    6.  } );
    7. </script>
  7. Scroll Follow uses the “top” property of an object to slide it. Therefore, the “position” of the object must be set to either “relative” or “absolute.” Other than that limitation, the Scroll Follow object should be completely configured through CSS.
  8. http://kitchen.net-perspective.com/open-source/scroll-follow/
没有标签
首页      前端资源      jquery模仿淘宝首页侧边指定区域固定悬浮效果JQUERY SCROLL FOLLOW

随身笔记

jquery模仿淘宝首页侧边指定区域固定悬浮效果JQUERY SCROLL FOLLOW
OVERVIEW Scroll Follow is a simple jQuery plugin that enables a DOM object to follow the page as the user scrolls. Scroll Follow has been successfully tested on IE6, IE7, FF…
扫描二维码继续阅读
2013-10-15