Hi guys, I need some help and info with this code I have. It shows an id on certain days e.g. 0=sunday and so on...
Code:
var rightNow = new Date();
var day = rightNow.getDay();
if (day == 0) {
$('#Shape1').show();
}
if (day == 1) {
$('#Shape1').hide();
}
if (day == 2) {
$('#Shape1').hide();
}
if (day == 3) {
$('#Shape1').hide();
}
if (day == 4) {
$('#Shape1').hide();
}
if (day == 5) {
$('#Shape1').hide();
}
if (day == 6) {
$('#Shape1').hide();
}
});
Everything works fine but what im needing now is to add a time function to make Shape1 to .hide at a certain time of the day if the #Shape1 is set to .show on lets say 'sunday'.
I add the var:
Code:
var hour = rightNow.getHours();
But this is the part im stuck with, heres my attempt...
Code:
if (day == 0) {
$('#Shape1').show();
}
else {
if((hour>= 9) && (hour<= 17)) {
$('#Shape1').hide();
}
Any help is hugly appreciated.
Regards,
paffley