Skip to content

Instantly share code, notes, and snippets.

@zerosignalproductions
zerosignalproductions / requestAnimationFrame.js
Created July 23, 2013 14:52
Add requestionAnimationFrame/cancelAnimationFrame support for all browsers. Source: https://gist.github.com/paulirish/1579671/#comment-846392
(function(window) {
'use strict';
var lastTime = 0,
vendors = ['moz', 'webkit', 'o', 'ms'],
x;
// Remove vendor prefixing if prefixed and break early if not
for (x = 0; x < vendors.length && !window.requestAnimationFrame; x += 1) {
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
var rtime = new Date(1, 1, 2000, 12,00,00);
var timeout = false;
var delta = 200;
$(window).resize(function() {
rtime = new Date();
if (timeout === false) {
timeout = true;
setTimeout(resizeend, delta);
}
});
function Set_Cookie( name, value, expires, path, domain, secure ) {
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );
/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/