Skip to content

Instantly share code, notes, and snippets.

@TheGP
Last active September 22, 2016 20:27
Show Gist options
  • Select an option

  • Save TheGP/a569a6c71df17c5923e6 to your computer and use it in GitHub Desktop.

Select an option

Save TheGP/a569a6c71df17c5923e6 to your computer and use it in GitHub Desktop.
comebacker turn off for iframes (improved function)
/* jQuery('.articles iframe').first() должно быть подогнано под сайт. если там всего 1 ифрейм, то достаточно jQuery('iframe') */
var comebacker_no_more_off = false;
var comebacker_turn_off = setInterval(function(){
if ('undefined' != typeof(comebacker) && 'undefined' != typeof(comebacker['settings']) && true == comebacker['settings']['launch']) {
jQuery('iframe').on('mouseover', function(){ if (0 == jQuery('#comebacker_main_div iframe:visible').length) comebacker['settings']['launch'] = false; }).on('mouseout', function(){ if (0 == jQuery('#comebacker_main_div iframe:visible').length) comebacker['settings']['launch'] = true; });
window.clearInterval(comebacker_turn_off);
}
}, 100);
/*
function comebacker_after_cancel() {
comebacker_no_more_off = true;
}*/
@TheGP

TheGP commented Sep 22, 2016

Copy link
Copy Markdown
Author

Если нужно чтобы камбекер так и оставался выключенным после наведения на ифрейм, нужно заменить mouseout на mouseout123 например

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment