You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose this, which (apart from working) should be faster as it does not manipulate the entire dom, and since this script is for the image hover, it doesn't make sense to execute it before the images are loaded, as was the case with using DOMContentLoaded. window.addEventListener("load", function () { document.body.insertAdjacentHTML('beforeend', '<div id="trailimageid"></div>') });
Why this was not a problem previously is something I cannot justify spending another minute on!
The text was updated successfully, but these errors were encountered:
lat9
referenced
this issue
in lat9/zen_Image-Handler
Oct 10, 2017
in jscript_imagehover.js, the document.addEventListener clause has been added around the original code:
document.addEventListener("DOMContentLoaded", function (event) { if (document.getElementById || document.all) { document.body.innerHTML += '<div id="trailimageid"></div>'; } });
I found this stopped all my other scripts from working.
Eventually (don't ask how long...) I discover this:
http://stackoverflow.com/questions/5113105/manipulating-innerhtml-removes-the-event-handler-of-a-child-element
I propose this, which (apart from working) should be faster as it does not manipulate the entire dom, and since this script is for the image hover, it doesn't make sense to execute it before the images are loaded, as was the case with using DOMContentLoaded.
window.addEventListener("load", function () { document.body.insertAdjacentHTML('beforeend', '<div id="trailimageid"></div>') });
Why this was not a problem previously is something I cannot justify spending another minute on!
The text was updated successfully, but these errors were encountered: