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
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: