How to use the <sn-time-timer> tag in a widget?

Unique45
Mega Sage

Can anyone tell me how to use the <sn-time-timer> tag in a widget?

 

Thanks in advanced!

@Ankur Bawiskar 

Please mark correct/helpful if this helps you!
1 REPLY 1

Tushar
Kilo Sage
Kilo Sage

Hi @Unique45 

 

In your widget's HTML, you can include the <sn-time-timer> element to render the timer.

for eg -

 

<sn-time-timer
  duration="300"
  on-complete="myFunction()">
</sn-time-timer>

 

 

If you use the on-complete attribute, you can define a JavaScript function in your widget's client-side code that will be called when the timer reaches zero.

 

For eg-

 

function myFunction() {
  // This function is called when the timer reaches zero.
  alert('Timer completed!');
}

 

 

You can also apply CSS styles to the <sn-time-timer> element to control its appearance.

This can be done through your widget's CSS or by referencing external styles.

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar