raoul2000/yii2-sidr-widget

Sidr小部件是Sidr jQuery插件的包装,用于创建侧边菜单。

安装次数: 3,424

依赖: 0

建议者: 0

安全: 0

星级: 2

关注者: 4

分支: 1

开放问题: 0

类型:yii2-extension

1.0.0 2015-02-04 16:48 UTC

This package is not auto-updated.

Last update: 2024-09-18 08:02:35 UTC


README

Sidr小部件是围绕Sidr jQuery插件的一个包装,用于创建侧边菜单,并且是"制作响应式菜单的最简单方式"。

安装

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

运行以下命令

php composer.phar require --prefer-dist raoul2000/yii2-sidr-widget "*"

"raoul2000/yii2-sidr-widget": "*"

将以下内容添加到你的composer.json文件的require部分。

用法

使用Sidr小部件非常简单。例如

<?php
use raoul2000\widget\sidr\SidrAsset;
use raoul2000\widget\sidr\Sidr;

// The Sidr plugin comes with 2 built-in theme : 'dark' and 'light'
// In this example we will use the light theme

SidrAsset::$theme = SidrAsset::THEME_LIGHT;
?>

<!-- This button will open/close the side menu -->
<button id="open-menu">open/close Menu</button>

<!-- This is the menu header and content -->
<header id="demoheader">
	<h1>Demos &amp; Usage</h1>
</header>

<div id="demo-content">
	<p>
		Lorem ipsum dolor sit amet, consectetur adipisicing elit.
		 Quasi nihil ab possimus temporibus 
		illum ullam molestiae aliquam maiores .
	</p>
</div>

<!-- include the Sidr Widget -->
<?= Sidr::widget([
	'selector' => '#open-menu',
	'pluginOptions' => [
		'name' =>  'sidr-menu',
		'source' => '#demoheader, #demo-content',
		'onClose' => new yii\web\JsExpression('
			function() {
				alert("bye bye side menu !");
			}
		')
	]
]); ?>

有关插件选项的更多信息,请参阅Sidr github页面

替代方案

许可证

yii2-sidr-widget采用BSD 3-Clause许可证发布。有关详细信息,请参阅捆绑的LICENSE.md文件。