simialbi/yii2-animate

animate.css,由 daneden 开发,用于 yii 框架

安装数: 1,670

依赖者: 0

建议者: 0

安全: 0

星标: 2

关注者: 3

分支: 3

开放问题: 0

语言:JavaScript

类型:yii2 扩展

1.0 2018-09-13 16:03 UTC

This package is auto-updated.

Last update: 2024-09-14 20:09:43 UTC


README

此扩展将 daneden 的 animate.css 集成到 yii2 框架中。

资源

安装

安装此扩展的首选方式是通过 composer

运行以下命令

$ php composer.phar require --prefer-dist simialbi/yii2-animate

或者将以下内容添加到 composer.jsonrequire 部分

"simialbi/yii2-animate": "*"

使用方法

注册资源包

在视图中注册(例如:@app/views/layouts/main.php

<?php
/* @var $this \yii\web\View */
use simialbi\yii2\animatecss\AnimateCssPluginAsset;

AnimateCssPluginAsset::register($this);

或者将以下内容添加到您的 assets/AppAsset.php

<?php
class AppAsset extends \yii\web\AssetBundle {
	public $depends = [
		'simialbi\yii2\animatecss\AnimateCssPluginAsset',
	];
}

示例用法

通过数据属性

在视图中使用它,如下所示

<?php
/* @var $this \yii\web\View */

$this->title = 'My Yii Application';
?>
<div class="site-index">
    <div class="jumbotron" data-animation="tada">
		<h1>Congratulations!</h1>
 
		<p class="lead">You have successfully created your Yii-powered application.</p>
		
		<p>
			<a class="btn btn-lg btn-success" href="https://yiiframework.cn">Get started with Yii</a>
		</p>
	</div>
</div>

通过 JavaScript

在视图中使用它,如下所示

<?php
/* @var $this \yii\web\View */

$this->title = 'My Yii Application';
?>
<div class="site-index">
    <div class="jumbotron">
		<h1>Congratulations!</h1>
 
		<p class="lead">You have successfully created your Yii-powered application.</p>
		
		<p>
			<a class="btn btn-lg btn-success" href="https://yiiframework.cn">Get started with Yii</a>
		</p>
	</div>
</div>
<?php
	$this->registerJs("jQuery('.jumbotron').animateCss('tada')");
?>

更多信息请参阅 官方 animate.css 文档

许可证

yii2-animate 基于 MIT 许可证发布。有关详细信息,请参阅捆绑的 LICENSE