Yii2 Equalize.js Asset
Simple asset bundle for equalize.js jQuery plugin (http://tsvensen.github.io/equalize.js/)
Equalize.js is a jquery plugin that allows make divs with equal height or width., (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist nerburish/yii2-equalize "dev-master"
or add, (*4)
"nerburish/yii2-equalize": "dev-master"
to the require section of your composer.json
file., (*5)
Usage
You can register the asset in your AppAsset, (*6)
class AppAsset extends AssetBundle
{
...
public $depends = [
...
'nerburish\equalize\EqualizeAsset'
];
}
or use it directly in a view, (*7)
<?php
\nerburish\equalize\EqualizeAsset::register($this);
?>
And then use as it is described in the documentation (http://tsvensen.github.io/equalize.js/):, (*8)
<div id="height-example" class="example">
<div>equalize</div>
<div>equalize content height</div>
<div>equalize</div>
<div>equalize</div>
<div>equalize</div>
<div>equalize content</div>
<div>equalize</div>
<div>equalize</div>
<div>equalize content height</div>
<div>equalize</div>
</div>
<?php $this->registerJs('$('#height-example').equalize(); // defaults to height') ?>