Play Interaction after X Clicks
Play a Webflow interaction after clicking on an element X number of times on your Webflow site. A unique way to create unique interactions that are based on the number of times an element is clicked.
Play a Webflow interaction after clicking on an element X number of times on your Webflow site. A unique way to create unique interactions that are based on the number of times an element is clicked.
How to add it
- Add the Javascript code to the closing body custom code section
- Update 15 with the number of clicks and update the class names
The code
Javascript
<!-- Add to body close section -->
<script>
// Replace 15 with your desired number of clicks
let stickerCount = 0;
$('.class-of-items-user-will-click').on("click", function() {
$(this).off("click");
stickerCount++;
//Check if all stickers have been clicked
if(stickerCount == 15){
$('.class-of-item-with-click-interaction').click();
}
});
</script>