All Projects → Illyism → Jquery.vibrate.js

Illyism / Jquery.vibrate.js

Licence: gpl-2.0
💲 Vibration API Wrappers

Projects that are alternatives of or similar to Jquery.vibrate.js

Litecart
LiteCart - Free Shopping Cart Platform - Built with PHP, jQuery HTML 5 and CSS 3
Stars: ✭ 132 (-5.04%)
Mutual labels:  jquery
Webapiclientgen
Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
Stars: ✭ 134 (-3.6%)
Mutual labels:  jquery
Dotnetdesk
Asp.Net Example web application showing the capabilities of ASP.NET Core 2 MVC, EF (Entity Framework), Web API, Bootstrap, jQuery, datatables, adminlte template and many more. Web app created as helpdesk or ticket support portal.
Stars: ✭ 136 (-2.16%)
Mutual labels:  jquery
Oblog
An Auto Rendering 🔽 Blogging System Based on MarkDown & Vue.js | 自动渲染装载 MarkDown 内容的博客系统
Stars: ✭ 133 (-4.32%)
Mutual labels:  jquery
Ruoyi Oracle
(RuoYi)官方仓库 基于SpringBoot的权限管理系统 易读易懂、界面简洁美观。 核心技术采用Spring、MyBatis、Shiro没有任何其它重度依赖。直接运行即可用
Stars: ✭ 134 (-3.6%)
Mutual labels:  jquery
Editor.md
The open source embeddable online markdown editor (component).
Stars: ✭ 11,741 (+8346.76%)
Mutual labels:  jquery
Klik Socialmediawebsite
Complete PHP-based Login/Registration system, Profile system, Chat room, Forum system and Blog/Polls/Event Management System.
Stars: ✭ 129 (-7.19%)
Mutual labels:  jquery
Project Website Template
A HTML/CSS Template for Building Projects or Personal Websites
Stars: ✭ 138 (-0.72%)
Mutual labels:  jquery
Makesen
响应式企业门户网站 jQuery/Bootstrap开发
Stars: ✭ 134 (-3.6%)
Mutual labels:  jquery
Hexaflip
🧊 Visualizes arrays as cube interfaces
Stars: ✭ 135 (-2.88%)
Mutual labels:  jquery
Roothub
使用 SSM 和 MySQL 开发的论坛系统
Stars: ✭ 131 (-5.76%)
Mutual labels:  jquery
Toastr
👀 toastr.js notifications for Laravel 5 and Lumen
Stars: ✭ 133 (-4.32%)
Mutual labels:  jquery
Vue Circle Progress
A Vue.js component to draw animated circular progress bars
Stars: ✭ 135 (-2.88%)
Mutual labels:  jquery
Chyrp Lite
An ultra-lightweight blogging engine, written in PHP.
Stars: ✭ 131 (-5.76%)
Mutual labels:  jquery
Learnquery
Learn JavaScript fundamentals by building your own jQuery equivalent library
Stars: ✭ 136 (-2.16%)
Mutual labels:  jquery
Keyboard
Virtual Keyboard using jQuery ~
Stars: ✭ 1,670 (+1101.44%)
Mutual labels:  jquery
Jquery Ui
The official jQuery user interface library.
Stars: ✭ 10,997 (+7811.51%)
Mutual labels:  jquery
Jquery Confirm
A multipurpose plugin for alert, confirm & dialog, with extended features.
Stars: ✭ 1,776 (+1177.7%)
Mutual labels:  jquery
Photojshop
🎨 Photo editing JavaScript library
Stars: ✭ 137 (-1.44%)
Mutual labels:  jquery
Slide And Swipe Menu
⚡️ A sliding swipe menu that works with touchSwipe library.
Stars: ✭ 135 (-2.88%)
Mutual labels:  jquery

This library was to be published hand-to-hand with my article on the Vibration API. You can also view the documentation.

Does my Device Support the API?

The vibration API is implemented in navigator.vibrate. So calling the function makes your phone vibrate. You can test if your browser is recent enough to have the vibrate function in navigator.

Mozilla had their own implementation mozVibrate so some browsers may support that instead.

var canVibrate = "vibrate" in navigator || "mozVibrate" in navigator;

if (canVibrate && !("vibrate" in navigator))
    navigator.vibrate = navigator.mozVibrate;

However, this doesn't mean that your device can vibrate. Just that it's recent enough. There are a few requirements you need to meet.

  1. You need the hardware for it.
  2. The page needs to be visible.
  3. Browser-specific implementation prevents the vibration.

Usage

jquery.vibrate.js

You can embed using bower with bower install jquery.vibrate.js. Or you can download the zip file and extract the build/jquery/* files.

The javascript files are located in build/jquery/jquery.vibrate.min.js.

Download and embed the code then initialize in one of the following ways.

// Vibration for 50ms on all .button on click
$(".button").vibrate();

// Vibrate for 20ms on click
$(".button").vibrate("short");

// Vibrate for 50ms on click
$(".button").vibrate("medium");
$(".button").vibrate("default");
$(".button").vibrate(50);

// Vibrate for 100ms on click
$(".button").vibrate("long");

// Vibrate for 40ms on touchstart
$(".button").vibrate({
    duration: 40,
    trigger: "touchstart"
});

// Vibrate twice
$(".button").vibrate({
    pattern: [20, 200, 20]
});

Development

I'm using grunt and node for building the docs. Grunt and jasmine for testing. Check out the gruntfile.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].