'Show random DIV with refresh once a week?
we found a fiddle to show random DIVs by refreshing the Page. This Code works fine, but now we want to edit this Code and we want that the DIVs will just refresh once a week. Is this possible?
<div id-="fancy_box">
<div id="inline" class="various0" style="display:none;">
<div style="padding:20px;">
This is the content of that shows inside the fancybox modal 1.
</div>
</div>
<div id="inline" class="various1" style="display:none;">
<div style="padding:20px;">
This is the content of that shows inside the fancybox modal 2.
</div>
</div>
$(function(){
$(".various"+(new Date().getTime() % 2)).css("display", "block");
});
You will found the fiddle here: https://jsfiddle.net/bkoenig/Lx0weyp9/
We want to use it for something like a "Deal of the week" that changes every monday.
Hope u could help us.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|