Jumper provides a simple integration with Jump.js, a small, modern, dependency-free smooth scrolling library.

Features

Requirements

Optional Requirements

If you need to support old browsers (IE9), include requestAnimationFrame polyfill yourself into your own custom libraries from any below: Note: IE10+ supports rAF, no need to include it.

Installation

Install the module as usual: Visit admin/modules, and enable the Jumper module. More info can be found on: http://drupal.org/documentation/install/modules-themes/modules-7

Usages

Custom Usages

  1. Add a class `jumper` to any link / button element containing attributes [data-target], or [href] with relevant target to scroll to, e.g.: <a href="#main" class="jumper">Jump</a> or <a href="#" data-target="#main" class="jumper">Jump</a> or <button data-target="#main" class="jumper">Jump</button>
  2. Include the provided block via block admin, or load the `jumper/load` library as needed accordingly.
  3. To position the Jumper block anywhere, use a simple CSS override, e.g.:
       /** Position the Jumper block at the bottom left corner. */
       .jumper.jumper--block {
           left: 15px;
       }
    
       /** Or center it at the bottom of page. */
       .jumper.jumper--block {
           left: 50%;
           right: auto;
           -ms-transform: translateX(-50%) translateY(100%);
           transform: translateX(-50%) translateY(100%);
       }
    
      .is-jumper-visible .jumper.jumper--block {
          -ms-transform: translateX(-50%) translateY(0);
          transform: translateX(-50%) translateY(0);
      }
    
    By default, Jumper block is positioned at the bottom right.

Stylings

The styling is very basic. Use your own icons and CSS to override defaults. Specific to the provided block, it has additional class `jumper--block` with a particular styling for a single jumper block.

Related modules

Known Issues

The `jumper` namespace is because `jump` is already reserved by `jump` menu module for different purposes. However `jumper` is still based on original jump.js intended singleton. Why not `jumpjs`, or `jumpingjackflash`? Maybe, but the author said: "... naming it according to your preference".