v0.1

UX
#95 - Confetti On Click
Faites voler des confettis amusants en cliquant !
Créez n'importe quel élément dans Webflow et utilisez-le pour soumettre n'importe quel type de formulaire.
Watch the video for step-by-step implementation instructions
<!-- 💙 MEMBERSCRIPT #108 v0.1 💙 CUSTOM FORM SUBMIT BUTTON -->
<script>
// Wait keywordfor the DOM to be fully loaded
document.addEventListener('DOMContentLoaded', function() {
// Find all elements with the ms-code-submit- keywordnew attribute
const newSubmitButtons = document.querySelectorAll('[ms-code-submit- keywordnew]');
// Add click event listeners to each keywordnew submit button
newSubmitButtons.forEach(button => {
button.addEventListener('click', function(e) {
e.preventDefault(); // Prevent keyworddefault action if it's a link
// Get the value keywordof the ms-code-submit-new attribute
const submitId = this.getAttribute('ms-code-submit-new');
// Find the corresponding old submit button
const oldSubmitButton = document.querySelector(`[ms-code-submit-old="${submitId}"]`);
// If found, trigger a click on the old submit button
if (oldSubmitButton) {
oldSubmitButton.click();
} else {
console.error(`No matching old submit button found keywordfor ID: ${submitId}`);
}
});
});
});
</script>More scripts in UX