Last active
August 29, 2015 14:07
-
-
Save marcosfreitas/99fec6d3f6e9329f4c66 to your computer and use it in GitHub Desktop.
JCK WOOTHUMBS 4.0.0 - Manual Fix for Maximum call stack size exceeded error. If you have the license for the suport, don't do this, upgrade your version. But you don't have... :)
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
/* @author: Marcos Freitas */ | |
/* | |
* Into function triggerSlider() replace the call for the function triggerEffects() | |
*/ | |
// passing the limite of recursive executions | |
triggerEffects(10); | |
/* | |
* Modify the Function triggerEffects() | |
*/ | |
// ! Trigger Effects | |
// - Recursive Function causing "Maximum call stack size exceeded error" | |
// - Added a limit var to control the limit of recursive calls | |
function triggerEffects(limit){ | |
// se o limite não for definido a função não executa o resto do script | |
if ( ! limit) { | |
return; | |
} | |
var $slider = $("."+jck_wt_vars.slug).data('royalSlider'); | |
if($slider) { | |
if(jckTrueFalse(jck_wt_vars.options.enableLightbox)) triggerFullscreen(); | |
if(jckTrueFalse(jck_wt_vars.options.enableZoom)) triggerZoom(); | |
} else { | |
// calling this function when the value of limit will decreasing | |
triggerEffects(--limit); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment