承接 raoul2000/yii2-bgswitcher-widget 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

raoul2000/yii2-bgswitcher-widget

Composer 安装命令:

composer require raoul2000/yii2-bgswitcher-widget

包简介

This extension is a wrapper for the jQuery Background Image Switcher Plugin

README 文档

README

This extension is a wrapper for the jQuery Background Image Switcher Plugin

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

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

to the require section of your composer.json file.

Usage

Once the extension is installed, and assuming that our 3 images are stored in @webroot/images/background, simply use this code by :

<?php
	use raoul2000\widget\bgswitcher\BgSwitcher;
	
	BgSwitcher::widget([
		'selector' => '#targetId',
		'pluginOptions' => [
			'images' => [
				'images/background/image1.jpg',
				'images/background/image2.jpg',
				'images/background/image3.jpg',
				'http://placehold.it/350x150'   // this image is remote
			]
		]
	]);
?>

<div id="targetId" class="cover-bg" style="width:100%;height:250px;">
	<p>some text here ... </p>
</div>

Below is an example of a CSS style to apply to the target container :

.cover-bg {
	background-repeat: no-repeat;
	background-position: center;
	background-attachment: fixed;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;
}

For complete documentation please refer to the official BgSwitcher page. You may also have a look to the Github project page.

If this plugin did not convinced you, have a look to the Backstretch Plugin

License

yii2-bgswitcher-widget is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

统计信息

  • 总下载量: 107
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固