Jump to content

Code to change pictures?


Recommended Posts

Yeah....I use this (sorta-comlicated) javascript code on my website:

 

<!--
function create() {
this.width = ''
this.height = ''
this.src = ''
this.href = ''
this.border = ''
this.mouseover = ''
}

ads = new Array()
for(var i=1; i<=5; i++) { ads[i] = new create() }

ads[1].width = ""
ads[1].height = ""
ads[1].src = ""
ads[1].href = """
ads[1].border = ""
ads[1].mouseover = ""

ads[2].width = ""
ads[2].height = ""
ads[2].src = ""
ads[2].href = ""
ads[2].border = ""
ads[2].mouseover = ""

ads[3.width = ""
ads[3.height = ""
ads[3.src = ""
ads[3.href = ""
ads[3.border = ""
ads[3.mouseover = ""

ads[4].width = ""
ads[4].height = ""
ads[4].src = ""
ads[4].href = ""
ads[4].border = ""
ads[4].mouseover = ""

ads[4].width = ""
ads[4].height = ""
ads[4].src = ""
ads[4].href = ""
ads[4].border = ""
ads[4].mouseover = ""

var n = Math.random() + ''
n = parseInt(n.charAt(5))

if(n >5) {
n = n - 5
}

else if(n==0) {
n = n + 5
}
n += ""

var image = ads[n]
var ad = ""
ad += '<a href="' + image.href + '" \n'
ad += 'onMouseOver="self.status=\'' + image.mouseover + '\'\;return true" \n'
ad += 'onMouseOut="self.status=\'\'"> \n'
ad += '<img src="' + image.src + '" width=' + image.width
ad += '\n height=' + image.height + ' border=' + image.border

 

Thats what makes them switch between 5 different image links everytime a page loads/refreshes...

 

I hope thats what you were talking about ;)

Link to comment
Share on other sites

Yeah, that's what I understood when I read your post...

it is probably possible to do it, but I don't know how so far. Will lurk on some sites and give you link if I find it :P

 

 

EDIT :

 

I found this site

http://www.scripts.com/viewscript/bannerblair-live/13955/

 

I have no idea how well it works, so you will have to try it by yourself, but the descrition seems acurate to what you are looking for.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...