/** * jquery.scrollFollow.js * Copyright (c) 2008 Net Perspective (http://kitchen.net-perspective.com/) * Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php) * * @author R.A. Ray * * @projectDescription jQuery plugin for allowing an element to animate down as the user scrolls the page. * * @version 0.4.0 * * @requires jquery.js (tested with 1.2.6) * @requires ui.core.js (tested with 1.5.2) * * @optional jquery.cookie.js (http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/) * @optional jquery.easing.js (http://gsgd.co.uk/sandbox/jquery/easing/ - tested with 1.3) * * @param speed int - Duration of animation (in milliseconds) * default: 500 * @param offset int - Number of pixels box should remain from top of viewport * default: 0 * @param easing string - Any one of the easing options from the easing plugin - Requires jQuery Easing Plugin < http://gsgd.co.uk/sandbox/jquery/easing/ > * default: 'linear' * @param container string - ID of the containing div * default: box's immediate parent * @param killSwitch string - ID of the On/Off toggle element * default: 'killSwitch' * @param onText string - killSwitch text to be displayed if sliding is enabled * default: 'Turn Slide Off' * @param offText string - killSwitch text to be displayed if sliding is disabled * default: 'Turn Slide On' * @param relativeTo string - Scroll animation can be relative to either the 'top' or 'bottom' of the viewport * default: 'top' * @param delay int - Time between the end of the scroll and the beginning of the animation in milliseconds * default: 0 */ ( function( $ ) { $.foldBox = function ( box, options ){ var $content=$('.content',$(box)); var $button= $('.drop',$(box)); if($(box).hasClass(options.searchBox)){ //搜索框 $content=$('#searchForm',$(box)); var insertHtml='