I used this code:
$('#calendar img').each(function () {
if (new Date($(this).data('date')).getTime() < new Date().getTime()-24*60*60*1000) {
$(this).css({
opacity: 0.5,
border: '2px solid red'
});
}
});
문제
I am making a calendar for March, which includes each day is a block (div) that contains that day offer, but when the day has passed, it must change the image to another one, but must remain visible.
How can I do this? I have found to show specific day, week etc, but to do exactly that I am baffled..
Thanks
해결책
I used this code:
$('#calendar img').each(function () {
if (new Date($(this).data('date')).getTime() < new Date().getTime()-24*60*60*1000) {
$(this).css({
opacity: 0.5,
border: '2px solid red'
});
}
});