The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Rotating ads

2 posters

Go down

Rotating ads Empty Rotating ads

Post by jeffcpr July 4th 2012, 5:21 pm

The last question was answered so fast I figured I would try another one. Is there and html code to rotate ads in the forum widgets.
I have ads on the sides of my forum that are placed one on top of the other. I have seen on other sites how the ads will change position each time the page is opened. Is there a way to do this with html code or is s there something different that I need to do.

Thanks
jeffcpr
jeffcpr
Forumember

Posts : 156
Reputation : 0
Language : English

Back to top Go down

Rotating ads Empty Re: Rotating ads

Post by Mike July 4th 2012, 5:30 pm

Code:
<script type="text/javascript">

//Javascript Created by Computerhope http://www.computerhope.com

//store the quotations in arrays

var images = [],
index = 0;

images[0] = "<a href = 'LINK'><img src='IMAGE'></a>";

images[1] = "<a href = 'LINK'><img src='IMAGE'></a>";

images[2] = "<a href = 'LINK'><img src='IMAGE'></a>";

images[3] = "<a href = 'LINK'><img src='IMAGE'></a>";

index = Math.floor(Math.random() * images.length);

document.write(images[index]);

//done

</script>
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Rotating ads Empty Re: Rotating ads

Post by jeffcpr July 4th 2012, 5:34 pm

OK is it <script type="text/javascript"> all the html ad code and then </script> at the end to get the rotation working.
I am new to html and really am learning as I go.

Thansk
jeffcpr
jeffcpr
Forumember

Posts : 156
Reputation : 0
Language : English

Back to top Go down

Rotating ads Empty Re: Rotating ads

Post by Mike July 4th 2012, 9:42 pm

just replace this:

Code:
<a href = 'LINK'><img src='IMAGE'></a>

LINK = forum/website link

IMAGE = Image link
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Rotating ads Empty Re: Rotating ads

Post by jeffcpr July 6th 2012, 9:03 pm

Sorry I tried did not work for me again I am new to HTML Code anymore ideas would be great.
jeffcpr
jeffcpr
Forumember

Posts : 156
Reputation : 0
Language : English

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum