derekisbusy/yii2-waypoints

Waypoints assets for Yii2 projects

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2019-06-23 21:15 UTC

This package is auto-updated.

Last update: 2024-04-24 09:04:46 UTC


README

Waypoints assets for Yii2 projects

Installation

The preferred way to install this extension is through composer.

Either run

php composer require --prefer-dist derekisbusy/yii2-waypoints:dev-master

or add

"derekisbusy/yii2-waypoints": "dev-master"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it by adding it to your view :

use \derekisbusy\waypoints\WaypointsAsset;

WaypointsAsset::register($this);

or by adding it to another assets dependencies list :

  public $depends = [
    'derekisbusy\waypoints\WaypointsAsset'
  ];

Then use waypoints in your view :

<script>
var waypoint = new Waypoint({
  element: document.getElementById('waypoint'),
  handler: function(direction) {
    console.log('Scrolled to waypoint!')
  }
})
</script>

Documentation