New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jquery-shake

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-shake

The shake effect from jQuery UI extracted to be used as a standalone plugin.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
145
-40.82%
Maintainers
1
Weekly downloads
 
Created
Source

h1. jQuery Shake

The shake effect from jQuery UI extracted to be used as a standalone plugin.

I needed to use the shake effect for a login page for a project inspired by the WordPress admin login page but I thought it silly to include the entirety of jQuery UI just for one effect, thus, I decided to extract the effect and have it work completely independent from jQuery UI.

Vanilla jQuery is required for this to work, along with the easing plugin if you want to use the easing functions.

From the jQuery UI docs:

h2. Description

Shakes the element multiple times, vertically or horizontally

h2. Options

direction (default: "left") Type: String A value of "left" or "right" will shake the element horizontally, and a value of "up" or "down" will shake the element vertically. The value specifies which direction the element should move along the axis for the first step of the effect.

distance (default: 20) Type: Number Distance to shake.

times (default: 3) Type: Number Times to shake.

speed (default: 140) Type: Number Animation duration.

easing (default: "easeInOutSine") Type: String The easing function to use.

callback (default: none) Type: function The callback function to use after animation end.

h2. Usage

Without options

bc.

Click Me

bc. $(document).ready(function() { $('#shake-me-default').on("click", function() { $(this).shake(); }); });

With options

bc.

Click Me

bc. $(document).ready(function() { $('#shake-me-option').on("click", function() { $(this).shake({ direction: "up", distance: 50 }); }); });

With callback

bc.

Click Me

bc. $(document).ready(function() { $('#shake-me-callback').on("click", function () { $(this).shake(function () { alert('callback'); }); }); });

Keywords

jquery

FAQs

Package last updated on 21 Nov 2017

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