Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My banner rotator is a no show!

    What's wrong with this please...

    Code:
    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();

  • #2
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by borzack View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •