Giter Site home page Giter Site logo

harlem-shake's Introduction

harlem-shake -> CSS3, jQuery plugin

Usage:

First include CSS and scripts:

<head>
...
<link rel="stylesheet" type="text/css" href="css/jquery.harlem-shake-1.0.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.harlem-shake-1.0.js"></script>
...
</head>

Music (harlem-shake.ogg) must be in music/harlem-shake.ogg (in next version this will be configurable)

jquery.harlem-shake-1.0.js searches for music/harlem-shake.ogg (relative path)

Then you can trigger plugin on click or on page load, but I don't recommend on page load because most people don't like autoplayed sounds on webpage

<script>
	$(function() {

		$('.start').click(function() {
			//just add elements you want to animate
			$('.example, .header1, .header2, .header').harlemShake();
		});

		$('.stop').click(function() {
			//you can stop harlem shake with 'stop' option
			$('.example, .header1, .header2, .header').harlemShake('stop');
		});
	});
</script>

You can set additional options in data attribute if you use HTML5:

<div class="harlem-shake-element" data-pivot="true" data-animation="flash" data-animation-speed="fast">
	flash
</div>

In example above I used data animation "flash" and animation will be "fast".

Pivot (first dancer): You can set pivot with data-pivot="true". Pivot should be only one and my recommendation is to use animation "rotateHalf".

Data animation speed can be "slow" or "fast": data-animation-speed="fast|slow"

Data animation has following options (most are taken from animate.css):

  • rotate
  • rotateHalf
  • scale
  • jump
  • flash
  • shake
  • bounce
  • tada
  • swing
  • wobble
  • wiggle
  • pulse
  • flip
  • flipInX
  • flipOutX
  • flipInY
  • flipOutY
  • fadeIn

Live example on http://hromnik.com/web/harlem-shake/example-page.html

harlem-shake's People

Contributors

elfoslav avatar

Stargazers

Rodrigo Z. Armond avatar Milebroke avatar Tomy Guichard avatar  avatar Hasan Güngör avatar  avatar Mutlaq Aldhbuiub avatar Shahzoda D. avatar Loïc Vaillé avatar Malgorzata Mitros avatar B avatar Yves Engetschwiler avatar Johannes Gorset avatar Carolina Hadad avatar 黎明 avatar Jan Dolecek avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.