homepage Welcome to WebmasterWorld Guest from 54.227.215.140
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
javascript to automatically change content every 24 hours
ipetronella

5+ Year Member



 
Msg#: 3752686 posted 2:44 pm on Sep 26, 2008 (gmt 0)

Hi,

I need a script that will allow automatic updates of content every so often.

For example, I have 4 images, image1.jpg, image2.jpg, image3.jpg and image4.jpg.

I want image1.jpg to be displayed on Monday. Then by midnight I want to swap automatically to image2.jpg and so on.

I need a script that will work with either images, links or small amounts of text.

Can anyone help me out?

Thanks!

 

httpwebwitch

WebmasterWorld Administrator httpwebwitch us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3752686 posted 4:27 pm on Sep 26, 2008 (gmt 0)

Hi ipetronella!

the script you describe will have a few simple ingredients.

1) calculate the number of days that have passed since Jan 1, 1970. That should be easy to do - just divide the current time [w3schools.com] by 86400000 (the number of milliseconds in a day). Round it down with Math.floor() to remove the decimal fraction.

var d = new Date();
var t = d.getTime();
var days = Math.floor(t / (86400000));

2) put your images in an array

var imagearray = new Array('image1.jpg','image2.jpg'...);

3) use the MOD operator (%) to find the remainder when you divide days by the number of images in the array.

var i = days % imagearray.length;

4) then show the image corresponding to that value.

var img = new Image();
img.src = imagearray[i];

Study and absorb this technique - it's incredibly useful. You can use it whether the array is full of image URLs, strings, numbers, or whatever you want. Modify the millisecond amount (86400000) if you want the rotation to happen faster or slower (ie you can do half days, hours, minutes, etc.)

good luck, and welcome to WebmasterWorld!

ipetronella

5+ Year Member



 
Msg#: 3752686 posted 7:04 pm on Sep 26, 2008 (gmt 0)

Hi and thanks for responding. May I add that I don't know any JavaScript, my coding abilities don't go much further than XHTML/CSS.

Could you give me an example of that this would look like?

And also, does this method allow you to display the images in order, and not randomly? This is very important.

astupidname

5+ Year Member



 
Msg#: 3752686 posted 3:24 pm on Sep 27, 2008 (gmt 0)

Hi,
I am fairly new to javascript myself, and it seems to me that using the MOD operator as httpwebwitch suggests is overly complicated and confusing? And hard to know what will be displayed on what day? Why not just use the appropriate date object method?
I also don't see the need to pre-load the image. I could be out of line as I am somewhat of a newb yet myself so please correct me if I am wrong -anybody!
If you are just wanting a rotation based on the day of the week use getDay() with a date object. Or if you want it based on day of the month use getDate(). If you want it hourly, use getHours() and so on... for a list of javascript date object methods go to w3schools.com javascript date object reference [w3schools.com]
The example I have provided below will change a links href= value and it's innerHTML and an images src= value based on the day of the week. Place the elements in the body of the html with your default values and text for them and give each of the elements an id and then refer to it's id in the script with getElementById. Then the elements will be altered by the script with the window.onload event in the script.

<!DOCTYPE -be sure to use one of these!
<html>
<head>
<title></title>
<script type="text/javascript">
window.onload = function(){chgDailyImg();}
function chgDailyImg()
{
var imagearray = new Array();
imagearray[0] = "sundaypic.jpg";
imagearray[1] = "mondaypic.jpg";
imagearray[2] = "tuesdaypic.jpg";
imagearray[3] = "wednesdaypic.jpg";
imagearray[4] = "thursdaypic.jpg";
imagearray[5] = "fridaypic.jpg";
imagearray[6] = "saturdaypic.jpg";

var linkarray = new Array();
linkarray[0] = "sundaypage.html";
linkarray[1] = "mondaypage.html";
linkarray[2] = "tuesdaypage.html";
linkarray[3] = "wednesdaypage.html";
linkarray[4] = "thursdaypage.html";
linkarray[5] = "fridaypage.html";
linkarray[6] = "saturdaypage.html";

var textarray = new Array();
textarray[0] = "This is sunday's text - click to go to sunday's page";
textarray[1] = "This is monday's text - click to go to monday's page";
textarray[2] = "This is tuesday's text - click to go to tuesday's page";
textarray[3] = "This is wednesday's text - click to go to wednesday's page";
textarray[4] = "This is thursday's text - click to go to thursday's page";
textarray[5] = "This is friday's text - click to go to friday's page";
textarray[6] = "This is saturday's text - click to go to saturday's page";

var d = new Date(); /*** create a date object for use ***/
var i = d.getDay(); /*** use the date object to get the day of the week - this will be a number from 0 to 6 - sunday=0, saturday=6 -it's the way counting works in javascript it starts at 0 like in the arrays ***/
document.getElementById("dailyImg").src = imagearray[i];
document.getElementById("dailyLink").href = linkarray[i];
document.getElementById("dailyLink").innerHTML = textarray[i];
}
</script>
</head>
<body>
<div>
<a href="sundaypage.html" id="dailyLink">This is sunday's text - click to go to sunday's page</a>
<img src="sundaypic.jpg" alt="daily pic" title="daily pic" width="300" height="100" id="dailyImg" />
</div>
</body>
</html>

httpwebwitch

WebmasterWorld Administrator httpwebwitch us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3752686 posted 6:49 pm on Sep 29, 2008 (gmt 0)

Cheers astupidname (I am embarassed to call you that, it feels like I'm insulting you), and welcome to WebmasterWorld!

For a javascript beginner, using the MOD operator may seem bizarre, but I suggest that it's a very useful technique to know, definitely worth learning. You'll find the technique incredibly useful in many applications. And I wouldn't call it complicated, since it is just dividing one number by another and getting a remainder result...

BUT
If you always want a Monday photo to show up on Monday, then your method is precise and superior. It wasn't really clear to me whether that was a requirement, but you could read the question that way for sure.

When you have a collection of 20 items and want a new one every day, then "mod"ding the current day is more effective, and simple since it only takes a few lines of code.

So there ya go ipetronella - two valid solutions to your problem, depending on how you want it to behave.

Good luck

P.S. if you are really that new to Javascript that you have trouble translating an idea into a working script, there are lots of great online tutorials you can read - and you might also want to pick up "Javascript: The Definitive Guide" (the one with the Rhino on the cover)

edited: the book title and some typos

[edited by: httpwebwitch at 7:28 pm (utc) on Sep. 29, 2008]

LifeinAsia

WebmasterWorld Administrator lifeinasia us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3752686 posted 7:03 pm on Sep 29, 2008 (gmt 0)

Then by midnight I want to swap automatically to image2.jpg and so on.

One other thing to point out (that may not be so obvious if you are a JS beginner) is that JS runs on the client side, not the server. So different users may be seeing different images at the same time.

For example, if it is midnight in Chicago, a user in Los Angeles will still be seeing one day's image while users in New York will be seeing the next day's image.

(And that' assuming people have the correct date/time set on their computers).

Depending on your desired intent, that may be perfectly okay. In other cases, where you need to have all users seeing the same image, then JS is going to break down and you need to develop a server-side solution.

P.S. And I completely agree with the book recommendation! I don't use it much any more (don't do a lot of JS coding these days), but when I do use it, it's almost always exactly what I need!

[edited by: LifeinAsia at 7:05 pm (utc) on Sep. 29, 2008]

astupidname

5+ Year Member



 
Msg#: 3752686 posted 9:19 pm on Sep 29, 2008 (gmt 0)

Hi again,
Thanks for the welcome and further clarification, httpwebwitch, and.. uh.. the feelings kind of mutual! (As I am sure you are probably not really a witch!) :) (I've actually got the most perfect name on the web.. nah nah na nah nahhh!)

using the MOD operator... a very useful technique to know, definitely worth learning. You'll find the technique incredibly useful in many applications.

Absolutely agreed.

In other cases, where you need to have all users seeing the same image, then JS is going to break down and you need to develop a server-side solution.

LifeinAsia I think you may be forgetting about UTC time which could be used to make all viewers around the world see the same image at midnight UTC time, which is the same for everybody, however it would seem to be irrelevant whether they all see the same image at the same time, rather than after midnight their time, for most uses, unless the intent is to provide timely data. So to make all see the same image after midnight UTC time, it would use getUTCDay() instead of just getDay() in the script. No server script required. All the time stuff can be done with javascript whether you want to use the users local time or UTC time. You could use a TimezoneOffset to make everybody see the same image at midnight YOUR (webmasters) time, if wanted...
All that being said, server side would only have the advantage over client side in that the user may not have javascript enabled, although the huge majority (over 95% by some accounts) do.

Dabrowski

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3752686 posted 9:36 pm on Sep 29, 2008 (gmt 0)

Yeah, LifeInAsia, who has 2,600 more posts than astupidname.

You obviously forgot about UTC time. Come back when you're more experienced.

And thankyou astupidname for clarifying what ipetronella actually meant in his/her original post.

[edited by: Dabrowski at 9:38 pm (utc) on Sep. 29, 2008]

LifeinAsia

WebmasterWorld Administrator lifeinasia us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3752686 posted 10:21 pm on Sep 29, 2008 (gmt 0)

Didn't forget about it, but it's still irrelevant if the individual user doesn't have the computer's time or time zone settings correct. (Or if the user has JS tuned off.)

Like I said, depending on the desired intent, this may be perfectly okay. But for other applications where it is critical that 100% of the users see the exact same image, then a server-side solution would be preferable.

astupidname

5+ Year Member



 
Msg#: 3752686 posted 12:35 pm on Sep 30, 2008 (gmt 0)

After further review, I guess we all are right to some extent. Perhaps httpwebwitch is more correct after I think about it more. It is a matter of interpretation of the OP's original post I guess.

For example, I have 4 images

When you have a collection of 20 items and want a new one every day, then "mod"ding the current day is more effective

Yes, yes, yes, I can see that now

So there ya go ipetronella - two valid solutions to your problem, depending on how you want it to behave

If you have only 4 (or 5 or 20 or 71 or 193 or x number) of images that you want to display in order and then repeat the cycle, not caring that the third image won't always be shown on a tuesday, then httpwebwitch is absolutely correct, using the Mod technique will accomplish that better. I had overlooked the "total of 4 images" concept and assumed a weekly, per day, rotation.
So, ipetronella, if you only have 4 items you would like to rotate, without preference as to what day of the week they always appear, you could use the example I provided and pare down the arrays somewhat. And you would just need to remove the line in my script that reads var i = d.getDay(); and insert httpwebwitch's method:
var t = d.getTime();
var days = Math.floor(t/(86400000));
var i = days % imagearray.length;

And if you do that, make sure the imagearray and linkarray and textarray are all the same length (same number of items in each, as they each will use i to change the elements values).

And also ipetronella, in case you are not familiar with arrays in javascript, you could use either method of creating an array:
var imagearray = new Array('image1.jpg','image2.jpg','image3.jpg' etc.....);
or:
var imagearray = new Array();
imagearray[0] = "image1.jpg";
imagearray[1] = "image2.jpg";
etc...

either method of creating an array accomplishes the same thing, it won't matter which way you do it, just FYI.

Thanks, httpwebwitch, I have seen the light!

httpwebwitch

WebmasterWorld Administrator httpwebwitch us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3752686 posted 2:34 pm on Sep 30, 2008 (gmt 0)

I'm always happy to witness an epiphany.

To further refine the script, you might consider using a complex object instead of a multiple parallel arrays.

var items = [
{'image':'image1.jpg','text':'text for image one','link':'http://www.example.com/1'},
{'image':'image2.jpg','text':'text for image two','link':'http://www.example.com/2'},
{'image':'image3.jpg','text':'text for image three','link':'http://www.example.com/3'}
];

The syntax used above is JSON [json.org].

Creating and using complex objects (expressed as JSON) is another one of those simple, powerful techniques that you'll learn once, and wonder how you ever managed without.

Then you don't have to worry so much about the arrays being the same size, because it'll all be one unified collection; and you can get the pieces like this:

items[x].image
items[x].text
items[x].link

Dabrowski

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3752686 posted 10:31 pm on Sep 30, 2008 (gmt 0)

In Perl, that's called an Array of Hashes.

And belive me, start making data structures like that and they'll quickly get bigger, and more complex pretty quickly!

If you're going to mess with that stuff, plan your data structure first to make it as efficient as posible, or you'll eat memory and CPU time.

Sorry, off topic.

rossbullock

5+ Year Member



 
Msg#: 3752686 posted 11:42 pm on Jan 25, 2009 (gmt 0)

Hey everyone I am new hear and I am tryign to accomplish a similar effect on my site. Im not sure which would be my best bet for my situation. I would like to have a picture and a link on my homepage change every 15minutes. however after a year I want them to begin repeating.
So every year at say Jan 1. 12:00am would have the same picture and after that point every 15min the picutre/link will change corrosponding to the appropriate time/date throught the year.

Any help would be great as I am relatively new to how to go about doing this.

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3752686 posted 1:38 am on Jan 26, 2009 (gmt 0)

welcome to WebmasterWorld [webmasterworld.com], rossbullock!

i would suggest doing this server side instead of client side for scalability reasons.
if you want a unique image and link url every 15 minutes for a year your data structure has > 35,000 rows using the techniques described above.
think about asking the browser to download and parse a script that large.
it's an expensive way to select an image.

however if you can control the image name and url scheme you could simply calculate an index and append it to strings for the image source url and link url.

another consideration is dealing with leap years.
it would simplify the solution if you can call a year 365.25 days.
this means you have the cycle starting midnight the first year, 6am the second, noon the third, etc.

using the simplification of 365.25 days/year, you would calculate the time into the "current year" using the MOD operator and 86400000*365.25 and you would divide the remainder by 900000 (the number of milliseconds in 15 minutes) and floor it to get the index for "current 15 minutes" of the "current year".

Dabrowski

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3752686 posted 2:43 pm on Jan 26, 2009 (gmt 0)

You do realise that will need 35,040 images for 1 year?

astupidname

5+ Year Member



 
Msg#: 3752686 posted 8:22 am on Jan 27, 2009 (gmt 0)

You do realise that will need 35,040 images for 1 year?

Yeah, that was my first thought too, and 35,136 on leap years! But, somehow I don't suspect rossbullock seriously wants an array of that many items, but rather a smaller array that keeps repeating throughout the year, changing items displayed every 15 minutes?

another consideration is dealing with leap years.
it would simplify the solution if you can call a year 365.25 days.
this means you have the cycle starting midnight the first year, 6am the second, noon the third, etc.

using the simplification of 365.25 days/year, you would calculate the time into the "current year" using the MOD operator and 86400000*365.25 and you would divide the remainder by 900000 (the number of milliseconds in 15 minutes) and floor it to get the index for "current 15 minutes" of the "current year".

I think I would disagree with that, as I think you may be approaching the concept wrong. I would work off of the CURRENT years January 1 from the beginning, and break down the rest of the year into quarter-hour increments from there, as we live. See my example below. I believe it get's around the leap-year problem you're talking about.

I would like to have a picture and a link on my homepage change every 15minutes. however after a year I want them to begin repeating.
So every year at say Jan 1. 12:00am would have the same picture and after that point every 15min the picutre/link will change corrosponding to the appropriate time/date throught the year.

Well, anyhow, not exactly certain what you mean by 'appropriate time/date', other than always starting over from 0 on January 1st, but I felt like farting around with this a bit. This is not intended to be used with 35,040 items in the array, rather a smaller number of items in array (say, 50 or less total objects, otherwise look in to AJAX):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Change Quarter Hourly Image And Link And Text Element</title>
<script type="text/javascript">

/*****
* QuarterHourlyChanger function
** First param - arr - REQUIRED must be array of objects.
** Second param - imgId - id of image or false,
** Third param - linkId - id of link or false,
** Fourth param - textElemId - id of text element or false.
* Will always restart the variable 'num' at 0 on January 1st 00:00:00:000 of current year,
* so the first item in the array passed in to the function will always be used first in the new year,
* and will display, progressively, items from array advancing, in order, automatically on a timer every quarter hour,
* and re-starting from 0 after last item in array has been shown.
* The cycle is always based on number of 15 minute periods since January 1 of current year.
* So, if user enters page at 4:07 p.m. it will run, then run again at 4:15 p.m. and every quarter hour from there on.
* Theoretically, 35,040 15 minute cycles in non-leap year and 35,136 15 minute cycles in leap years.
*****/
function QuarterHourlyChanger(arr,imgId,linkId,textElemId) {
if (arr) {
var d = new Date(), newYear, num, ms, wait;
//newYear gets January 1st 00:00:00:000 of current year
newYear = Date.parse("Jan 1," + d.getFullYear());
//num will be a number from 0 to one less than the length of the array that is passed in
//(array's items start numbered from 0, except when counting length of array ~ length starts at 1 instead. How absurd.)
//num will always be 0 from 00:00:00 through 00:15:00 on January 1st (first fifteen minutes)
num = Math.floor((d.getTime() - newYear)/900000)%arr.length; //900,000 milliseconds = 15 minutes
if (imgId && arr[num].pic) {
document.getElementById(imgId).src = arr[num].pic;
}
if (linkId && arr[num].link) {
document.getElementById(linkId).href = arr[num].link;
}
if (textElemId && arr[num].text) {
document.getElementById(textElemId).innerHTML = arr[num].text;
}
////now let's synchronize and set up a timer for this function to run on the quarter hour
//(assuming you can get a user to stay on your page for 15 minutes [you're good!],
//the items will be changed on every quarter hour).
//ms gets how many milliseconds are left in current hour (an hour has 3,600,000 milliseconds total)
ms = 3600000 - ((d.getMinutes()*60000) + (d.getSeconds()*1000));
//wait calculates how many milliseconds until the next quarter hour
wait = (ms > 2700000) ? ms - 2700000 : (ms > 1800000) ? ms - 1800000 : (ms > 900000) ? ms - 900000 : ms;
window.setTimeout(function() {
QuarterHourlyChanger(arr,imgId,linkId,textElemId);
},wait);
}
};

window.onload = function(){
var someArr = [
{ pic:'images/1m.gif', link:'somePage1.html', text:'Go to somePage1.html' },
{ pic:'images/2m.gif', link:'somePage2.html', text:'Go to somePage2.html' },
{ pic:'images/3m.gif', link:'somePage3.html', text:'Go to somePage3.html' },
{ pic:'images/4m.gif', link:'somePage4.html', text:'Go to somePage4.html' },
{ pic:'images/5m.gif', link:'somePage5.html', text:'Go to somePage5.html' } //<--- note, no comma after last object!, continue pattern as needed
];
QuarterHourlyChanger(someArr,'quarterHourImg','quarterHourLink','quarterHourSpan');
//example if you want to skip an element and not use a link element:
//QuarterHourlyChanger(someArr,'quarterHourImg',false,'quarterHourSpan'); //won't need link:value in array object to be passed
//or if just an image change is desired:
//QuarterHourlyChanger(someArr,'quarterHourImg'); //won't need link:value or text:value in array objects, just pic:value
};

</script>
</head>
<body>
<div>
<a href="somePage1.html" id="quarterHourLink">
<img src="somePic1.jpg" alt="picture" title="Quarter Hourly Pic" width="300" height="100" id="quarterHourImg"><br>
<span id="quarterHourSpan">Go to somePage1.html</span></a>
</div>
</body>
</html>


Dabrowski

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3752686 posted 4:01 pm on Jan 27, 2009 (gmt 0)

The math seems a bit overcomplicated but it's pretty much what I had in mind.

With regard to an array of image names though, this is the awkward bit, unless you just numbered the images 0.jpg to 35040.jpg. You could do this if the images were of nothing particularly important that you needed names for.

rossbullock

5+ Year Member



 
Msg#: 3752686 posted 4:50 am on Feb 6, 2009 (gmt 0)

Thanks guys for all the help, unfortunatly yes I am serious and understand that this involves 35040pictures. I forgot about the issue of a leap year. I want the picture/link to update every 15 minutes. So picture 1 would be from Jan 1st 00:00 till 00:15 then the 2nd picture would be from 00:15 till 00:30. For my needs these pictures need to always come up at the same times every year. So even on March 1st the same picture needs to show up at the same time, regardless of a leapyear or not.

I understand this would be a huge amount of information and but i dont want to sacrafice load time. Would there be a more effiecent way to acheive this outside of using this technique.

Instead of loading everything when the page is first loaded, would there be a way to reload the page every 15min with the different picutre/link so it only loads a single picture/link everytime.

any ideas would be great as i've been working on this for quiet a while and im not sure if i should undertake this part of the project using this technique if there is a better one possible.

astupidname

5+ Year Member



 
Msg#: 3752686 posted 4:43 pm on Feb 6, 2009 (gmt 0)

For my needs these pictures need to always come up at the same times every year. So even on March 1st the same picture needs to show up at the same time, regardless of a leapyear or not.

That does complicate things somewhat, but can be overcome.
I understand this would be a huge amount of information and but i dont want to sacrafice load time. Would there be a more effiecent way to acheive this outside of using this technique.

Instead of loading everything when the page is first loaded, would there be a way to reload the page every 15min with the different picutre/link so it only loads a single picture/link everytime.

Yes indeed, a huge amount of information. And yes, it is do-able without reloading the page, if using javascript(like my example above)/AJAX. It brings up many necessary questions which would be:

  1. Image naming conventions? Will you be able to control and set the image names in a numerical order as Dabrowski suggests? (I did use numerical order in my example earlier in the array, but did not account for using any type of numerical-ordered-convention within the function (as opposed to having multiple array items defined) as I set that example up to use non-numerical-ordered convention if desired). Will images (35,136 of them) be all in the same directory, or multiple different directories?
  2. Link href paths? 35,136 different ones? Naming conventions for link href's, possibly in a numerical order? Will you need to enter all link href's manually instead?
  3. Additional text/captions desired as per my example regarding the QuarterHourlyChanger? How will you enter 35,136 different text's? Some repeat? Numerical ordered convention? Enter all text's manually?
  4. Is your server setup capable of using php & possibly mysql database? I ask this because it would probably be the best route to go, combine AJAX/php/possibly mysql database (which could be set up initially from an administrative build page). Note if php available, Image naming conventions will be totally unnecessary, can grab any garbled up named images from directory/directories and build either php array (which won't be sent to the client, just accessed via AJAX) or mysql database automatically instead of manually, although non-numerical-ordered convention will complicate determination of what images you want to appear when. That is not a problem if you don't care about the particular order (with exception of first image of year, which could be manually set) as long as it is always the same. But if a particular order is desired, and numerical-ordered naming convention is not used, will have to determine order manually.

Note I use the number 35,136 above as that is what you will actually need to work with, as any program will need to use 35,040 of them on non-leap years, and do some shifting to use 35,136 on leap years and still show the exact same images after Feb 29 as in a non-leap year. More about the 'shifting' later.

So, answer all those questions, and you will be further along. I may be interested in toying with it some more if you do, but no guarantees!

Dabrowski

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3752686 posted 5:10 pm on Feb 6, 2009 (gmt 0)

Russ, do you want the page to change dynamically? (sp?)

I mean, if a user leaves his browser open, do you want the image/link to change on the next 15 min?

Also, is the image itself a link, or do you want a separate link underneath?

There are 2 things that would make this much simpler, if the image was only required on page load, you could even use SHTML to keep the payload off the browser.

If you didn't want a separate link underneath the image this could be done entirely on naming conventions, no need for a pre-populated database, and no need for you to enter those 35,136 href and text entries!

I think I could do this pretty easily, I'll put something together later that we can expand on.

rossbullock

5+ Year Member



 
Msg#: 3752686 posted 9:30 am on Feb 12, 2009 (gmt 0)

Dabrowski- Yes I am looking for this to change dynamically, and the link does not have to be underneath the image, it could be that the image is the link itself. Whichever would work best I could work with for that part.

astupidname- yes I will be able to control image names and put them in numerical order, and Im not sure what you mean about directory, but from my understanding yes they will be all together. link href's would not be able to do numerical as they will be to other webpages so that would be manual. as for the text It would all be manual as well as it would be specific names etc. corresponding to the picutre. I have not determined a server yet so I could choose one to fit those requirments.

Order is key, so at any paticular time, the specific picture/link/text that was chosen for that time be shown. And always be shown exactly at that same time everyyear(even on leapears, adding in the extra images etc for Feb29th on the leapyear)

I tried to answer all those questions, hope it makes things more clear and able to figure things out.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved