Code

Mirror Click Script

Trigger a click on another element when one element is clicked in Webflow. This is perfect for allowing one element to control a click of another element.

Mirror Click Script preview

Trigger a click on another element when one element is clicked in Webflow. This is perfect for allowing one element to control a click of another element.

How to add it

  1. Add the Javascript code to your closing body tag
  2. Update .trigger and .recipient with your target classes

The code

Javascript
                      <!-- Add to closing body section -->
<script>
$('.trigger').on('click', function(evt) {
    setTimeout(function() {
        $('.recipient').triggerHandler('click'); //element js will click
    }, 500); //ms of time before action
});
</script>

                    

Browse similar code snippets

Categories

Language

More from Corey Moen

Profile →

Similar code snippets

All code snippets →