View elementCheck.js
This file contains 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 waitForElement() { | |
if (!document.querySelector("/* put element selector here */")) { | |
window.requestAnimationFrame(waitForElement); | |
} else { | |
/* put code to fire after element exists here */ | |
} | |
}; |
View timeOnPageTracker.js
This file contains 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
setInterval(function(){ | |
if(parseInt(timeSpentOnSite/1000) >= 5){ | |
window._vis_opt_queue = window._vis_opt_queue || []; | |
window._vis_opt_queue.push(function() {_vis_opt_goal_conversion(212);}); | |
} | |
if(parseInt(timeSpentOnSite/1000) >= 10){ | |
window._vis_opt_queue = window._vis_opt_queue || []; | |
window._vis_opt_queue.push(function() {_vis_opt_goal_conversion(213);}); | |
} | |
if(parseInt(timeSpentOnSite/1000) >= 20){ |
View scrollEventTracker.js
This file contains 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 scrollPos = window.innerHeight; | |
window.addEventListener('scroll', function(e) { | |
var pos = window.scrollY + window.innerHeight; | |
window._vis_opt_queue = window._vis_opt_queue || []; | |
if (scrollPos < pos) { | |
// down | |
if ((document.querySelector('div.top').getBoundingClientRect().top + window.scrollY) < pos) { | |
window._vis_opt_queue.push(function() { | |
_vis_opt_goal_conversion(200); | |
}); |
View gist:74c6161d887a5f3cee7fa9c1185c65df
This file contains 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 arrayLocation = []; | |
var arrayArea = []; | |
var arrayTheme = []; | |
$('#g-body').prepend('<select style="display: block;" id="select1"></select><select style="display: block;" id="select2"></select><select style="display: block;" id="select3"></select>'); | |
$('div#plase ul.m-tileLink:eq(0) > li').each(function(i,e){ | |
arrayLocation.push([vwo_$(this).children('a').html(), vwo_$(this).children('a').attr('href')]); | |
}); | |
$('div#plase ul.m-tileLink:eq(1) > li').each(function(i,e){ | |
arrayArea.push([vwo_$(this).children('a').html(), vwo_$(this).children('a').attr('href')]); |
View imageselect-vwo.js
This file contains 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
vwo_$('a#severModalBTN, a#selectModalBTN').on('click', function(element) { | |
step2(vwo_$('#select-server input[type*="radio"]').filter(':checked').attr('value')); | |
}); | |
function step2(input) { | |
switch (input) { | |
case '27': | |
isSlimOrNot = true; | |
step3(vwo_$('div.normal').find(':checked').attr('value')); | |
break; |