bootstrap-switch-button icon indicating copy to clipboard operation
bootstrap-switch-button copied to clipboard

When onload allready exist inton the document they are killed

Open devX2712 opened this issue 5 years ago • 0 comments

On your code you replace window.onload by your functionnality, instead of adding your's to list of existing

I propose you to use this way /** * Replace all .switch-button inputs with "Bootstrap-Switch-Button" * Executes once page elements have rendered enabling script to be placed in <head> / if (typeof window !== 'undefined') var func = function() { document.querySelectorAll('input[type=checkbox][data-toggle="switchbutton"]').forEach(function(ele) { ele.switchButton(); }); if (window.addEventListener) { window.addEventListener('load', func()); } else { window.attachEvent('onload', func()); } / window.onload = function() { document.querySelectorAll('input[type=checkbox][data-toggle="switchbutton"]').forEach(function(ele) { ele.switchButton(); }); */ }; Thank's

devX2712 avatar Oct 08 '20 15:10 devX2712