Text Rotate on refresh

Discussion in 'PHP' started by Pandemix, Apr 6, 2008.

  1. #1
    Hey, I need a random text rotator on my site that changes on refresh. Like how a random banner rotator works.

    What I want is the same exact concept as MaxBlogPress Stripe Ad (http://www.maxblogpress.com/plugins/msa/), except I need it for a website.

    thanks.
     
    Pandemix, Apr 6, 2008 IP
  2. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <script language="JavaScript">
    function rotateEvery(sec)
    {
    var Quotation=new Array()

    // QUOTATIONS
    Quotation[0] = 'First quotation';
    Quotation[1] = 'Second quotation';
    Quotation[2] = 'Third quotation';
    Quotation[3] = 'Fourth quotation';
    Quotation[4] = 'Fiveth quotation';
    Quotation[5] = 'Sixth quotation';
    Quotation[6] = 'You can add <b>as many</b> quotations <b>as you like</b>';

    var which = Math.round(Math.random()*(Quotation.length - 1));
    document.getElementById('textrotator').innerHTML = Quotation[which];

    setTimeout('rotateEvery('+sec+')', sec*1000);
    }
    </script>
    </head>
    <body onload="rotateEvery(1)">
    <div id="textrotator"><!--Quotations will be displayed here--></div>
     
    singh.ajit05, Apr 6, 2008 IP
  3. Pandemix

    Pandemix Well-Known Member

    Messages:
    954
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Now quite what I need, I need one that rotates on refresh.
     
    Pandemix, Apr 7, 2008 IP