Untitled
unknown
plain_text
2 years ago
836 B
8
Indexable
<button id="corner-button" class="fixed-corner-button">Toggle</button>
.fixed-corner-button {
position: fixed;
bottom: 0;
right: 0;
z-index: 1000;
padding: 10px 20px;
border: none;
border-radius: 50%;
background-color: #333;
color: #fff;
cursor: pointer;
}
.fixed-corner-button:hover {
background-color: #444;
}
const cornerButton = document.getElementById('corner-button');
cornerButton.addEventListener('click', () => {
if (cornerButton.classList.contains('active')) {
disableFunctions();
cornerButton.classList.remove('active');
} else {
enableFunctions();
cornerButton.classList.add('active');
}
});
function enableFunctions() {
// Call function 1
function1();
// Call function 2
function2();
}
function disableFunctions() {
// Disable function 1
// Disable function 2
}Editor is loading...
Leave a Comment