Trigger Voxel Popup for Any Action

Description/Instructions

This will trigger the login pop up for whatever action you want or button click 

If this snippet helped, feel free to buy me a taco :)

Instructions

Add the class “click-to-login” to whatever button or container

document.addEventListener('DOMContentLoaded', function () {
// Find all containers with the class "click-to-login"
var containers = document.querySelectorAll('.click-to-login');

// Add click event listener for each container
containers.forEach(function (container) {
container.addEventListener('click', function (event) {
// Prevent default behavior
event.preventDefault();

// Call the Voxel.requireAuth function or any other custom action
Voxel.requireAuth(event);

// Additional custom actions can be added here
});
});
});

  • JS
Copy Code

Let's Chat About this Snippet