Need Help on Rotating Banner Code on .blogspot

Discussion in 'HTML & Website Design' started by arena84, Sep 6, 2008.

  1. #1
    Hello
    As title above, I need help on code to make a rotating banner on blogspot. for example: I have 2 banners, A and B. I want A and B banner to rotate/appear everytime the visitors reload the page. hope somebody can help me. thanks in advance.
     
    arena84, Sep 6, 2008 IP
  2. arena84

    arena84 Well-Known Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #2
    So anybody can help me?? or make a suggestion?
     
    arena84, Sep 6, 2008 IP
  3. gameOn

    gameOn Member

    Messages:
    624
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    35
    #3
    Here is a simple Banner rotator made in JS

    
    <script language="Javascript">
    <!--
    // original content taken from Nic's JavaScript Page with permission
    // lack of these three lines will result in copyright infringment
    // made by: Nic's JavaScript Page - http://www.javascript-page.com
    
    var currentdate = 0;
    var core = 0;
    
    function initArray() {
    
    this.length = initArray.arguments.length;
      for (var i = 0; i < this.length; i++) {
      this[i] = initArray.arguments[i];
      }
    }
    
    link = new initArray(
    "http://3bgraphics.hypermart.net/",
    "http://html.digitalsea.net/",
    "http://www.javascript-page.com/"
    );
    
    image = new initArray(
    "http://3bgraphics.hypermart.net/link/3bgraphics.gif",
    "http://html.digitalsea.net/htmlnow.gif",
    "http://www.geocities.com/~jsmaster/jsnow.gif"
    );
    
    text = new initArray(
    "3B Graphics",
    "Learn HTML in 7 Easy Steps",
    "Nic's JavaScript Page"
    );
    
    var currentdate = new Date();
    var core = currentdate.getSeconds() % image.length;
    var ranlink  = link[core];
    var ranimage = image[core];
    var rantext  = text[core];
    
    document.write('<a href=\"' +ranlink+ '\" target=\"_blank\"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');
    
    //-->
    </SCRIPT>
    
    Code (markup):
    hope this helps :D
     
    gameOn, Sep 6, 2008 IP
  4. arena84

    arena84 Well-Known Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #4
    thank you so much.

    eh wait, is it working on blogger template code?
     
    arena84, Sep 7, 2008 IP
  5. gameOn

    gameOn Member

    Messages:
    624
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    35
    #5
    Javascripting should work anywhere.. no proplem :D
     
    gameOn, Sep 7, 2008 IP
  6. glitto

    glitto Notable Member

    Messages:
    2,839
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    205
    #6
    glitto, Sep 7, 2008 IP
  7. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #7
    From my search engine for Blogspot tips and tricks: Rotating Banners

    There are numerous hacks in this list. One should fit the bill.

    One thing you have to remember is that Blogspot does not allow you to upload files, such as stylesheets, javascript. You need to get around that by using a free file hosting service. Usually most people use Google Sites for this type of thing.
     
    Dodger, Sep 7, 2008 IP