...

View Full Version : My banner rotator is a no show!



borzack
07-21-2007, 10:04 PM
What's wrong with this please...


var rotate_no = 2;
var banner = new Array(rotate_no);

banner.url[0] = escape('http://www.google.com');

banner.small_image[0] = escape('./banner/images/small1.jpg');
banner.small_width[0] = '300';
banner.small_height[0] = '300';
banner.small_params[0] = 'ico=' + banner.small_image[0];

banner.big_image[0] = escape('./banner/images/big2.jpg');
banner.big_width[0] = '720';
banner.big_height[0] = '720';
banner.big_params[0] = 'big=' + banner.big_image[1] + '&url=' + banner.url[1];

banner.url[1] = escape('http://www.yahoo.com');

banner.small_image[1] = escape('./banner/images/small2.jpg');
banner.small_width[1] = '100';
banner.small_height[1] = '100';
banner.small_params[1] = 'ico=' + banner.small_image[1];

banner.big_image[1] = escape('./banner/images/big2.jpg');
banner.big_width[1] = '650';
banner.big_height[1] = '650';
banner.big_params[1] = 'big=' + banner.big_image[1] + '&url=' + banner.url[1];

function pickRandom(range)
{ if (Math.random) return Math.round(Math.random() * (range-1)); else { var now = new Date(); return (now.getTime() / 1000) % range; } }

var rotate = pickRandom(rotate_no);



banner.putObjects = function () {

document.write('<div id="bannerSmall" style="position:absolute;width:'+ banner.small_width[rotate] +'px;height:'+ banner.small_height[rotate] +'px;z-index:9999;right:0px;top:0px;">');
document.write('<embed src="'+ banner.small_path[rotate] + '?' + banner.small_params[rotate] +'" name="bannerSmallObject" wmode="transparent" quality="high" width="'+ banner.small_width[rotate] +'" height="'+ banner.small_height[rotate] +'" flashvars="'+ banner.small_params[rotate] +'" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
document.write('</object></div>');
document.write('</script>');

document.write('<div id="bannerBig" style="position:absolute;width:'+ banner.big_width[rotate] +'px;height:'+ banner.big_height[rotate] +'px;z-index:9999;right:0px;top:0px;">');
document.write('<embed src="'+ banner.big_path[rotate] + '?' + banner.big_params[rotate] +'" id="bannerBigEmbed" name="bannerBigObject" wmode="transparent" quality="high" width="'+ banner.big_width[rotate] +'" height="'+ banner.big_height[rotate] +'" flashvars="'+ banner.big_params[rotate] +'" swliveconnect="true" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
document.write('</object></div>');

setTimeout('document.getElementById("bannerBig").style.top = "-1000px";',1000);
}
banner.putObjects();

Arty Effem
07-22-2007, 04:26 AM
What's wrong with this please...
That is no way to present a question. You need to make things as easy as possible for those who may investigate your problem.

Describe what happens/doesn't happen relative to what should.

Either confirm that no error messages appear in the console, or post any that do appear.

Post either the full code of a runnable test case, or the url of same.

Then maybe you'll get an answer.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum