dongyuanliao6204 2014-12-01 12:32
浏览 26
已采纳

在特定日期用不同的图像替换基本图像。 可能?

I need some help with the following; I have a private start page for my browsers. This page is also used by family and displays news, weather, etc.

Now to make it a bit nicer, I want the standard logo to be replaced by a image of Santa and a birthday cake on several birthdays. How do I achieve this and what's the best solution to use for this? PHP, jQuery or something else?

For example during Christmas the standard logo (logo.png) should be replaced with santa1.png or santa2.png.

On Eastern the standard logo (logo.png) should be replaced by bunny1.png, bunny2.png or easteregg.png And so on for various other days... You get the idea.

Unfortunately I don't have any programming skills. So if anyone could write up a small and easy to use code snippet, I would be very happy.

Thank you in advance.

//edit

Thank you for the replies and yes I do not have any skills in regards to programming, however I did start a search in regards to Javascript changing images on certain dates and I found the following:

        <script language="javascript">
         var pic='';
         mytime=new Date();
         mymonth=mytime.getMonth()+1;
         mydate=mytime.getDate();
         if (mymonth==7 && mydate==15){pic="<img src=/images/14.png width=300 height=300>";
         }
         else if (mymonth==7 && mydate==17){pic="<img src=/images/19.png width=300 height=300>";
         }
         else if (mymonth==7 && mydate==18){pic="<img src=/images/13.png width=300 height=300>";
         }
         else {
         pic="<img src=../img/logo.png width=480 height=82>"
         }
         document.write(pic);
       </script>

I think this is usable and what the person answered below meant, right?

  • 写回答

1条回答 默认 最新

  • dongqu9917 2014-12-01 12:34
    关注

    Use javascript. When the page loads, just check the date using new Date(), and if it matches with the specific user, just change the src attribute of the image.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入