It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Changing Graphics

Changing Graphics

Postby SuziQ on Fri Nov 03, 2006 5:37 pm

I need to change graphics from month to month on my website. For instance, I need to change an October graphic to a November graphic. Can can this be done using JavaScript (JS) and how is it done?

Help will be appreciated.

SuziQ[/url]
SuziQ
 
Posts: 2
Joined: Sun Oct 29, 2006 4:16 am

Graphics based on month

Postby Iain on Fri Dec 01, 2006 9:54 am

Hi Suzi

Iain here, I've got the same problem and I am trying to ase an if (date=something) the show (image name) type idea but can't get javascript to load a graphic after the if condition.

Tell you what though, when I get an answer, I'll fire it over to you. Perhaps you'd be good enough to do same! :D

Iain
Iain
 
Posts: 2
Joined: Thu Nov 30, 2006 11:19 am

Changing Graphics

Postby SuziQ on Sat Dec 02, 2006 5:01 am

Hi, Iain~

Will do. When I find out how to do this I'll be sure to let you know.

Suzi [/b]
SuziQ
 
Posts: 2
Joined: Sun Oct 29, 2006 4:16 am

Postby ngpgeeta on Sun Dec 17, 2006 10:32 am

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function changing()
{
var arr=new Array(1,2,3,4,5,6,7,8,9,0)
var dt=new Date()
dt=dt.getDate()+"/"+(dt.getMonth()+1)+"/"+dt.getYear()

switch(dt)
{
case "1/1/2006": document.first.src="two.jpg"
break
case "1/2/2006": document.first.src="three.jpg"
break
}

}
</script>
</head>
<BODY onload="changing()">
<img name="first" src="one.jpg" width=100 height=300>
</BODY>
</HTML>

Hope this helps!
ngpgeeta
 
Posts: 19
Joined: Sat Nov 18, 2006 11:30 am


Who is online

Users browsing this forum: No registered users and 7 guests