Wordpress Themes - Medios de comunicación - Kamala - Kamala - Expekt bonuses

PDA

View Full Version : Creating a random.


martinvidic
Dec 14th 2008, 10:40 am
Hello.

Maybe somebody can help we with this or give me a link to a tutorial.
I am using div tags to sort the my ad-codes at the end of my html files.

<div id='ads_code_1' style='display:none;'>
<!-- Ad Code 1 -->
</div>
<script language="JavaScript">
div1 = document.getElementById('adspace1');
div2 = document.getElementById('ads_code_1');
div1.innerHTML = div2.innerHTML;
div2.innerHTML = "";
</script>

<div id='ads_code_2' style='display:none;'>
<!-- Ad Code 2 -->
</div>
<script language="JavaScript">
div1 = document.getElementById('adspace2');
div2 = document.getElementById('ads_code_2');
div1.innerHTML = div2.innerHTML;
div2.innerHTML = "";
</script>

Now I want to create a 3rd adcode and alternate 2 & 3 randomly
<!-- Ad Code 2 --> and <!-- Ad Code 3 -->
So that only one of the two shows up.
Does anybody have an idea how to do that.

Thanx and best regards
M.V.

budster
Dec 15th 2008, 6:12 am
Hi
Have a look at the following link for a javascript ad rotator script creator.
http://www.astral-consultancy.co.uk/cgi-bin/hunbug/doco.cgi?11480
Hope this helps