ibrarturi / yii2-scrollup
jQuery插件scrollup的包装器
dev-master
2015-12-14 05:55 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-14 18:42:08 UTC
README
Yii2 扩展,它是jQuery插件scrollup的包装器
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
php composer.phar require --prefer-dist ibrarturi/yii2-scrollup "dev-master"
或者
"ibrarturi/yii2-scrollup": "dev-master"
将以下内容添加到您的 composer.json
文件的require部分。
使用方法
扩展安装完成后,只需在代码中通过以下方式使用它:
- 默认使用方法
<?= \ibrarturi\scrollup\ScrollUp::widget(); ?>
- 带有主题参数的使用方法
<?= \ibrarturi\scrollup\ScrollUp::widget([ 'theme' => 'tab', // pill, link, image, tab ]); ?>
- 带有默认可选参数的使用方法
<?= \ibrarturi\scrollup\ScrollUp::widget([ 'options' => [ 'scrollName' => 'scrollUp', // Element ID 'scrollDistance' => 300, // Distance from top/bottom before showing element (px) 'scrollFrom' => 'top', // 'top' or 'bottom' 'scrollSpeed' => 300, // Speed back to top (ms) 'easingType' => 'linear', // Scroll to top easing (see http://easings.net/) 'animation' => 'fade', // Fade, slide, none 'animationSpeed' => 200, // Animation speed (ms) 'scrollTrigger' => false, // Set a custom triggering element. Can be an HTML string or jQuery object 'scrollTarget' => false, // Set a custom target element for scrolling to. Can be element or number 'scrollText' => 'Scroll to top', // Text for element, can contain HTML 'scrollTitle' => false, // Set a custom <a> title if required. 'scrollImg' => false, // Set true to use image 'activeOverlay' => false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' 'zIndex' => 2147483647, // Z-Index for the overlay ] ]); ?>