This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* contentloaded.js | |
* | |
* Author: Diego Perini (diego.perini at gmail.com) | |
* Summary: cross-browser wrapper for DOMContentLoaded | |
* Updated: 20101020 | |
* License: MIT | |
* Version: 1.2 | |
* | |
* URL: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var findClass = function(className) { | |
var output = []; // Ініціалізуємо масив | |
var node = (typeof className === 'undefined' ? document.getElementsByTagName('body')[0] : document.getElementByClassName(className)).getElementsByTagName('*'); | |
for(var i=0; i<node.length; i++) { // перебираємо всі ноди | |
if(node[i].getAttribute('class')) { // якщо мають атрибут class | |
output[i] = node[i].getAttribute('class'); // заносимо список класів в вихідний масив | |
} | |
} | |
return output; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (window) { | |
var last = +new Date(); | |
var delay = 100; // default delay | |
// Manage event queue | |
var stack = []; | |
function callback() { | |
var now = +new Date(); | |
if (now - last > delay) { |
NewerOlder