JAY 2017-04-20 09:38:02 5344次浏览 8条评论 13 6 0

yii2-scroll-top

A Yii2 widget to add scroll-to-top button. Base on the .animate jQuery function.
Yii2 回到顶部按钮,基于jQuery的animate,支持自定义内容和样式。

Installation

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
或者把以下内容添加到composer.json中

"oonne/yii2-scroll-to-top": "*"

to the require section of your composer.json file.

Usage

基础用法:

<?= \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',
]); ?>
觉得很赞
您需要登录后才可以评论。登录 | 立即注册