ad rotator ad nauseum
Posted: Sat Oct 13, 2012 10:44 am
After Expression Web crashed and a few excited utterances I have gone back to the JavaScript which seems to be easier to assemble a page with.
On a game review, there is a section called "AS TESTED" which provides a PHP include of a table with machine specs and a image of the crappy WEI
so looking at my PHP usage, I have attempted over and over and I have not been able to get it to work right.
On a game review, there is a section called "AS TESTED" which provides a PHP include of a table with machine specs and a image of the crappy WEI
so looking at my PHP usage, I have attempted over and over and I have not been able to get it to work right.
Code: Select all
//Global variable that stores advertising banners.
var ads = new Array();
//Function that starts when the page finished loading.
window.onload = function(){
//Adds information about the new banners.
ads.push(<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=cpa07-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B0062U5KG6" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>);
ads.push(<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=cpa07-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B0076DO5A0" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>);
ads.push(<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=cpa07-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=B0053BSMPQ" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
);
//Starting rotation with the first banner.
ad_rotate(0);
}
function ad_rotate(active){
//Gets the div that will display banners.
var ad_element = document.getElementById("ad");
//Prints a new link with image in advertising box.
//ad_element.innerHTML = "<a href=\""+ads[active][0]+"\"><img src=\""+ads[active][1]+"\" alt=\""+ads[active][2]+"\" title=\""+ads[active][2]+"\" /></a>";
//Switches to the next banner.
active++;
//If the counter has reached the end, it shall start again from zero.
if(active >= ads.length){
active = 0;
}
}