• Resolved luboslives

    (@luboslives)


    Hi, I have a simple listener on the .hurrytimer-campaign element as suggested in your docs, but the hurryt:finished event does not appear to be firing when the timer expires.

    I’ve done monitorEvents() inside Chrome dev tools and I’m not seeing it fire there either. Is this an issue or is it just me?

    Running v2.6.3

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hi @luboslives

    Make sure you put the the event handler before the timer is loaded, the best place is before the </head> tag using for example the action wp_head, here’s a working example:

    function fire_when_timer_expires(){
    	?>
    	<script>
    	
    	(function($){
    		$(document).on('hurryt:finished','.hurrytimer-campaign', function(e, campaign){
    			console.log('campaign expired!');
    		});
    	})(jQuery);
    	
    	</script>
    	<?php
    }
    
    add_action('wp_head', 'fire_when_timer_expires');
    Thread Starter luboslives

    (@luboslives)

    Thanks @nlemsieh, that works. I tried getting it done without jQuery but no such luck.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘hurryt:finished JS event does not seem to be firing’ is closed to new replies.