WW OL Dropdown - Updated
WW OL Dropdown - Updated
(function() {
function createButton(label, left, action) {
var button = document.createElement("button");
button.innerHTML = label;
button.setAttribute('style', `position: absolute; z-index: 2500; padding:
2px; left:${left}%; top: 1%; background-color: #CCCCCC; color: #000000; border: 4px
solid #CCCCCC; border-radius: 8px; font-size: 14px; font-family: "Amazon Ember";
font-weight: bold; transition: background-color 0.3s, border-color 0.3s;`);
button.addEventListener('mouseover', function() {
this.style.backgroundColor = '#777777';
this.style.borderColor = '#777777';
});
button.addEventListener('mouseout', function() {
this.style.backgroundColor = '#CCCCCC';
this.style.borderColor = '#CCCCCC';
});
button.addEventListener('mousedown', function() {
this.style.backgroundColor = '#444444';
this.style.borderColor = '#444444';
});
button.addEventListener('mouseup', function() {
this.style.backgroundColor = '#777777';
this.style.borderColor = '#777777';
});
document.body.appendChild(button);
}
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
if (selectedRadio) {
selectedRadio.click();
} else {
throw `Radio button with value "${value}" not found in $
{containerClass}.`;
}
}
await delay(10);
function showError(errorMessage) {
var errorDiv = document.createElement("div");
errorDiv.innerHTML = errorMessage;
errorDiv.style.color = "red";
errorDiv.style.position = "absolute";
errorDiv.style.top = "50%";
errorDiv.style.left = "50%";
errorDiv.style.transform = "translate(-50%, -50%)";
errorDiv.style.zIndex = "9999";
errorDiv.style.backgroundColor = "#FFFFFF";
errorDiv.style.padding = "10px";
errorDiv.style.border = "1px solid #CCCCCC";
errorDiv.style.borderRadius = "4px";
errorDiv.style.fontSize = "16px";
errorDiv.style.fontFamily = "Amazon Ember";
document.body.appendChild(errorDiv);
setTimeout(() => {
errorDiv.style.opacity = 0;
setTimeout(() => {
document.body.removeChild(errorDiv);
}, 20);
}, 2000);
}