timer - Need javascript for buttons to appear/disapear at specific times of day -
i'm working within cms gives limited options - i'm in need of javascript or jquery method create buttons appear 30 minute intervals 5 times per day. complicate matters, times of day change weekend days. i'm beginner coding languages, i'm cornered using them cms.
logically, here's think need do: find day of week (mon-fri leads 1 schedule, sat-sun leads other) find time of day , display if within 30 minutes of trigger time.
any coaching code or approach appreciated. thanks!
var foo=(new date); //get current date foo.getday(); //get current day if(foo>5){ //weekend }else{ //weekday } setinterval(function(){},1000) //run function every second (1000 millisecond) i suggest checking minutes of current date @ set interval. if minutes lower 5 or between 30 , 35, show button else, hide button.
$("button").show() $("button").hide()
Comments
Post a Comment