I have the following glitch effect applied to a section of my page, however it can be quite distracting. I wish to create a toggle button to disable and re-enable the script.
http://eg-graphics.com/zwooper/EGVGV/Season3/MemoryWall.html
So to call the function I have the following code:
$( function() {
$( ".glitch-img" ).mgGlitch({
destroy : false, // set 'true' to stop the plugin
glitch: true, // set 'false' to stop glitching
scale: true, // set 'false' to stop scaling
blend : true, // set 'false' to stop glitch blending
blendModeType : 'hue', // select blend mode type
glitch1TimeMin : 600, // set min time for glitch 1 elem
glitch1TimeMax : 900, // set max time for glitch 1 elem
glitch2TimeMin : 10, // set min time for glitch 2 elem
glitch2TimeMax : 115, // set max time for glitch 2 elem
});
});
To disable this plugin i need to set it so it's destroy : true.
Where I struggle is that I am unable to recall the function with destroy:true and then again with destroy : false.
Thank you in advance