Skip to content

Instantly share code, notes, and snippets.

@alexcontes
alexcontes / wait-for-elements.js
Created September 21, 2018 07:52
Wait for elements
/**
* @param sel - the selector you want to wait for
* @param action - the callback that will be executed when element/s matching the given selector are found, it is passed the array of found elements
* @param stopLooking - if true the function will stop looking for more elements after the first match
*/
function waitForElems(sel, action, stopLooking) {
var tick;
var id = 'fke' + Math.floor(Math.random() * 12345);
var type = window.MutationObserver ? 'M' : 'S';
var lastMutation = Date.now();
/*
Theme Name: Avada Child
Description: Child theme for Avada theme
Author: ThemeFusion
Author URI: https://theme-fusion.com
Template: Avada
Version: 1.0.0
Text Domain: Avada
*/
@alexcontes
alexcontes / bower.json
Last active August 5, 2016 16:15 — forked from backflip/bower.json
Load Google Maps API using jQuery Deferred
{
"name": "load-google-maps",
"version": "1.0.0",
"main": ["./load-google-maps.js"],
"author": "Glenn Baker & Gavin Foley",
"dependencies": {
"jquery": ">=1.5"
},
"license": ["MIT", "GPL"],
"keywords": ["Google Maps", "Async"]