Support » Plugin: Jellyfish Counter Widget » Count up until an Ending Time

  • Resolved mwisconsin

    (@mwisconsin)


    I see how you can start the Jellyfish counter at a specific timestamp, but can you also have it stop at a certain time? So, anyone accessing the website after, say, 7pm, won’t see the counter increment.

    I imagine I could do this with an override in JavaScript, but I was hoping that the plugin had some facility or API to stop it.

    https://wordpress.org/plugins/jellyfish-counter-widget/

Viewing 1 replies (of 1 total)
  • Plugin Author Strawberry Jellyfish

    (@toxictoad)

    There isn’t an inbuilt stop time, but you could probably do this with JavaScript & jQuery reasonably easily. There are a few useful public functions in jellyfish-odometer,js that you can access though the counter dom element.

    For example, this would stop a counter with an id of #jellyfish-counter-shortcode-1:

    $('#jellyfish-counter-shortcode-1').data('jellyfishCounter').stop();

    So you could trigger some javascript on page load that stops a counter if the time is after 7pm or whatever you need. If you are generating a counter with a shortcode be sure to use the id parameter to set a unique id that you can use to target the counter in the javascript.

Viewing 1 replies (of 1 total)
  • The topic ‘Count up until an Ending Time’ is closed to new replies.