Commit 3e825bd3 authored by Ivan Abramenko's avatar Ivan Abramenko
Browse files

Issue #2758593 by b3nji: Need help with first steps to waypoint

parent 5cc9e51b
Loading
Loading
Loading
Loading

README.md

0 → 100644
+62 −0
Original line number Diff line number Diff line
CONTENTS OF THIS FILE
---------------------

* Introduction
* Requirements
* Installation
* Configuration
* Maintainers

INTRODUCTION
------------

Add jQuery Waypoints plugin to the site.

REQUIREMENTS
------------

Use composer to install module,
then it will install levmyshkin/waypoints automatically.

INSTALLATION
------------

* Install as you would normally install a contributed Drupal module. Visit
  https://www.drupal.org/node/1897420 for further information.

If you install modules manually (without composer),
then you will need to put waypoints library from here:
https://github.com/levmyshkin/waypoints

So jquery.waypoints.min.js file will be placed in:
/libraries/waypoints/lib/jquery.waypoints.min.js

CONFIGURATION
-------------

Open the module configuration form:
/admin/config/user-interface/waypoints

And enable checkbox "Always include JavaScript file to the site"

Usage example:
```
(function ($) {
  $(document).ready(function(){
    if ($('#block-1').length ) {
      var waypoint = new Waypoint({
        element: document.getElementById('block-1'),
        handler: function(direction) {
          $('.another-block')
            .toggleClass('someclass', direction === 'down');
        }
      });
    }
  });
}(jQuery));
```

MAINTAINERS
-----------

* [Ivan Abramenko](https://www.drupal.org/u/levmyshkin)