(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
var customeEventImageLoad = document.createEvent('Event'); | |
customeEventImageLoad.initEvent(myEventName, true, true); | |
on(window, myEventName, finalLazyLoadHandler, passiveEvent); |
// Test via a getter in the options object to see | |
// if the passive property is accessed | |
var supportsPassive = false; | |
try { | |
var opts = Object.defineProperty({}, 'passive', { | |
get: function() { | |
supportsPassive = true; | |
} | |
}); | |
window.addEventListener("test", null, opts); |
var module = {}; | |
module.throttle = function (fn, threshhold, scope) { | |
threshhold || (threshhold = 250); | |
var last, deferTimer; | |
return function () { | |
var context = scope || this; | |
var now = +new Date, | |
args = arguments; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
@echo off | |
if exist "svn.config" goto start | |
echo failed to find svn.config at same directory | |
goto end | |
:start | |
set "file=svn.config" | |
for /f "usebackq tokens=1* delims=:" %%a in ("%file%") do ( | |
set "%%a=%%b" |
// Code goes here | |
//loop obj | |
function rock(map,startCallBack,interval,isContinue,stopCallBack){ | |
var param = (function getFirstKey(){ | |
for(var key in map){ | |
return key; | |
} | |
})(); | |
function loop(){ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
<script src="script.js"></script> | |
</head> | |
<body> | |
<h1 id="logo"> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
<script src="script.js"></script> | |
</head> | |
<body> | |
<div class="parent"> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
<script src="script.js"></script> | |
</head> | |
<body> | |
<div class="parent"> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
<script src="script.js"></script> | |
</head> | |
<body> | |
<div class="parent"> |