2017-04-16
GitHub: https://github.com/oonne/yii2-scroll-to-top.
Author: JAY
A Yii2 widget to add scroll-to-top button. Base on the .animate jQuery function.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist oonne/yii2-scroll-to-top "*"
or add
"oonne/yii2-scroll-to-top": "*"
to the require section of your composer.json
file.
<?= \oonne\scrollTop\ScrollTop::widget() ?>
<?php use oonne\scrollTop\ScrollTop; ?> <?= ScrollTop::widget([ 'options' => 'custom-css class-name' ]); ?>
<?php use oonne\scrollTop\ScrollTop; ?> <?= ScrollTop::widget([ 'tagContent' => '<i class="top-icon"></i>', 'options' => 'custom-css class-name', ]); ?>
The following is Chinese translation.(以下是中文翻译)
Yii2 回到顶部按钮,基于jQuery的animate,支持自定义内容和样式。
通过 composer 进行安装。
执行以下命令:
php composer.phar require --prefer-dist oonne/yii2-scroll-to-top "*"
或把以下内容添加到composer.json中:
"oonne/yii2-scroll-to-top": "*"
基础用法:
<?= \oonne\scrollTop\ScrollTop::widget() ?>
自定义样式:
<?php use oonne\scrollTop\ScrollTop; ?> <?= ScrollTop::widget([ 'options' => 'custom-css class-name' ]); ?>
自定义内容和样式:
<?php use oonne\scrollTop\ScrollTop; ?> <?= ScrollTop::widget([ 'tagContent' => '<i class="top-icon"></i>', 'options' => 'custom-css class-name', ]); ?>