定制 dmstr/yii2-parallax 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dmstr/yii2-parallax

最新稳定版本:0.1.0

Composer 安装命令:

composer require dmstr/yii2-parallax

包简介

An extention to create AWESOME parallax effects.

README 文档

README

An extention to create AWESOME parallax effects.

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist dmstr/yii2-parallax "*"

or add

"dmstr/yii2-parallax": "*"

to the require section of your composer.json file.

Usage

  1. Register desired asset bundle in view
  2. Set the x and y to define direction and velocity. An extra optional parameter (startCondition) tells the element when it should start moving. use "asap" to move the element as soon as the scroll event fires. Use "visible" (default value) for those elements that should move as soon they become visible in the viewport.
  3. Scroll to see the AWESOME effect.

[data-parallax="{x}, {y}, {when}"]

Example with 3 parallax elements

<div data-parallax="0.2, -0.2, asap"></div>
<div data-parallax="0.2, -0.2, visible"></div>
<div data-parallax="0.2, -0.2"></div>
  • TIP: try it with css transitions on transform to create nicer effect.
  • TIP: to make realistic parallax effects, closer (alsor bigger) elements should move faster than elements tha are farther (also smaller).

Example widget usage

<?php Parallax::begin(['x' => 0.1, 'y' => -0.2, , 'startCondition' => 'visible']); ?>
<?= '... some content' ?>
<?php Parallax::end(); ?>

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 5
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-29