I need to toggle DIV
visibility based on time so my site shows when my physical store is open.
For example:
- 07:00-15:59 = Show div
- 16:00-06:59 = Hide div
Thanks!
Here is a basic example.
//gets the current time.
var d = new Date();
if(d.getHours() >= 7 && d.getHours() <= 15 ){
$(".open").show();
$(".closed").hide();
}
else {
$(".closed").show();
$(".open").hide();
}
https://jsfiddle.net/16mnrL3b/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With