/    Sign up×
Community /Pin to ProfileBookmark

Random Load Different Navigation Bar Each Time

Hello All,
I’ll try and make this simple. My experience with HTML and Javascript goes as far as I can throw my car. I’m decent in Photoshop and occation play in Dreamweaver. Saying that. I’m looking for update my World of Warcraft Guilds Website. Trying to keep it really really simple.

My Problem.

Every time someone types in the .com; I would like to have a different Navigation bar. Everytime they type the .com in. To pick from 4 random navigation bars.
Example: [URL=http://imageshack.us][IMG]http://img512.imageshack.us/img512/7763/navigationbar6cf.jpg[/IMG][/URL]

Heres a picture of the 4 navigation bars I would like to use.

I’m willing to learn what it takes to use the Javascript/HTML coding

Any help would be great.

thnks

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@UbikDec 22.2005 — Perhaps this will help:

http://www.irt.org/script/236.htm

Using that and an image map might do the trick, assuming the nav bar is an image, and the nav 'buttons' are always on the same place in the image.

This can be easily done if you have Server Side Scripting available from your host, such as cgi, perl, php, asp and/or .net or even cold fusion.
Copy linkTweet thisAlerts:
@ellicitDec 22.2005 — Ya, I would have said the same as ubik did.... The easies way you can do this is my runing a random image script, and image map the image, This way the 4 images will load, when someone comes to your site, but the image map code will remain the same

check out: images map by coffeecup, and I have a ramdon script.. I can give you that via email.... PM me!
Copy linkTweet thisAlerts:
@babyDauthorDec 23.2005 — thanks for pointing my in the right direction. I looked around the site and came across a javascript that would suit me the best.

http://www.irt.org/script/467.htm

I'm not to sure where to upload the variables( now and hour )

any help would be great.

thanks
Copy linkTweet thisAlerts:
@welshDec 23.2005 — place this in the head:
[code=html]
<script language="JavaScript">

var theImages = new Array()

theImages[0] = '100.jpg'
theImages[1] = '200.jpg'
theImages[2] = '300.jpg'
theImages[3] = '400.jpg'
theImages[4] = '500.jpg'

var j = 0
var p = theImages.length;

var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

</script>
[/code]


then use this in the regular html where u want the image to be:
[code=html]
<script language="JavaScript"> showImage(); </script>
[/code]

im just trying to figure out how to load the place the image map.
Copy linkTweet thisAlerts:
@babyDauthorDec 23.2005 — im just trying to figure out how to load the place the image map.[/QUOTE]

Thanks Welsh for the script. I'm trying to figure out the same thing.

When i put my index1-5.html inplace of the images

it does randomly pick. but when i view it.

I get only a red little X (normally where images fail to load)

I'm tried

href = showImage();

but that only brings up another red X. I'm not sure how to convert showImage() to direct it do the address index1-5.html

(keep inmind) my knowledge of Javascript is less than a week old. errr i'm completly stumpt

if anyone else knows how i might go about this. please post

thanks ?
×

Success!

Help @babyD spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...