Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

movver

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

movver

The concept of hover on touch devices.

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Movver.js (v0.0.4)

Introduction:

Movver exists solely to provide the concept of a hover on touch devices. It does this by keeping a log of where you're tapping to scroll and then figures out what you're most likely looking at on the remaining viewable portion of the screen. It has no dependencies, and works in all major mobile browsers. Simply attach callbacks to page elements and they'll be executed as they're being looked at.

Usage:

1. Include the library

<script src="your/path/to/movver.min.js"></script> or npm install movver or bower install movver.

2. Create a movver instance

var movver = new Movver(options);

options:

  • "debug": Colors monitored elements according to their focus threshold, and shows you where Movver things your thumb is blocking the screen. Defaults to false. See the debug screenshots section below for an image of what this looks like.
  • "touchAverage": The number of touches used to figure out an average for determining where your thumb is over the screen (1-∞). It has a sensible default, so probably best to leave alone. If you do change, I'd recommend using debug mode in conjunction to see how your changes affect behaviour.
  • "focusThreshold": The percentage amount a given element must be in focus before Movver triggers a movver event on it (0-100). Again, it has a sensible default.
  • "eventTimeout": The number of ms an element must be above the focus threshold before its movver event is triggered. Defaults to 1000ms.

3. Watch elements

movver.watch(element);

element: Can be either a vanilla Javascript DOM element or a jQuery selected DOM element.

4. Listen for a movver event

element.addEventListener('movver', function(e) {
  console.log("Movver thinks you're looking at", e.target);
});

5. Unwatch elements

movver.unwatch(element);

element: Can be either a vanilla Javascript DOM element or a jQuery selected DOM element.

Usage scenarios:

  • Pre-caching of content behind tappable page elements.
  • Lazy loading images.
  • Revealing content as it's viewed.
  • Mobile analytics (what are your users actually looking at?).

Development

  • To build the project npm run build.
  • To run the development demo server npm run server.

PR Wishlist:

  • Tablet format support, with tracking of individual thumbs.
  • Any further improvements to accuracy, usefulness at the singular task of figuring out what users might be looking at on touch devices.

Keywords

FAQs

Package last updated on 22 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc