GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — jQuery.Keyframes/README.md at master · lemonhall/jQuery.Keyframes

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
70 lines (56 loc) · 2.38 KB
/

README.md

Copy path

File metadata and controls

70 lines (56 loc) · 2.38 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

jQuery.Keyframes

jQuery.Keyframes generates and plays CSS3 keyframes quickly and easily allowing you to concentrate on the content of your project whilst cutting down code.

Example Usage

// Get browser style prefix
$.keyframe.browserCode();

// Detecting CSS animation support
$.keyframe.isSupported();

// Adding a new animation sequence (keyframe)
$.keyframe.define([{
	name: "trapdoor-sequence",
	"0%": "height:70px",
	"30%": "height:10px",
	"60%": "height:30px",
	"100%": "height:10px"
}]);

// Adding a single frame style
$.keyframe.define({
	name: "ball-roll",
	from: $.keyframe.browserCode()+"transform:rotate(0deg)",
	to: $.keyframe.browserCode()+"transform:rotate(360deg)",
});

// Adding multiple frame styles
$.keyframe.define([{
	name: "ball-roll",
	from: $.keyframe.browserCode()+"transform:rotate(0deg)",
	to: $.keyframe.browserCode()+"transform:rotate(360deg)",
	},
	{
	name: "half-rotation",
	from: $.keyframe.browserCode()+"transform:rotate(0deg)",
	to: $.keyframe.browserCode()+"transform:rotate(180deg)",
	}
]);


// Playing an animation
$(selector).playKeyframe({
	name: 'trapdoor-sequence', // name of the keyframe you want to bind to the selected element
	duration: 1000, // [optional, default: 0, in ms] how long you want it to last in milliseconds
	timingFunction: 'linear', // [optional, default: ease] specifies the speed curve of the animation
	delay: 0, //[optional, default: 0, in ms]  how long you want to wait before the animation starts in milliseconds, default value is 0
	repeat: 'infinite', //[optional, default:1]  how many times you want the animation to repeat, default value is 1
	direction: 'normal', //[optional, default: 'normal']  which direction you want the frames to flow, default value is normal
	fillMode: 'forwards' //[optional, default: 'forward']  how to apply the styles outside the animation time, default value is forwards
	complete: function(){} //[optional]  Function fired after the animation is complete. If repeat is infinite, the function will be fired every time the animation is restarted.
});

// Playing an animation (shorthand)
$(selector).playKeyframe('trapdoor-sequence 1000 linear 0 infinite normal forwards', complete);
	
// Reset the animation
$(selector).resetKeyframe(callback);

// Freeze keyframe animation and kill callbacks
$(selector).pauseKeyframe();

// Resume keyframe animation
$(selector).resumeKeyframe();
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.