Javascript Banner Rotator

Discussion in 'HTML & Website Design' started by carl_in_florida, Oct 19, 2006.

  1. #1
    I have tried 3 different rotators and went through a whole bunch of dead links off of a google search.

    Can somone pm me or post a simple javascript banner rotator script that works? I would really appreciate it.
     
    carl_in_florida, Oct 19, 2006 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Scroll down to 'similar threads'.
     
    T0PS3O, Oct 19, 2006 IP
  3. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #3
    There are two links to phpadsnew which i really don't want to learn to rotate a single banner, a link to hotscripts and a script that someone wrote and someone else says gives an error.

    Was looking for a working script.
     
    carl_in_florida, Oct 19, 2006 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    T0PS3O, Oct 19, 2006 IP
  5. ianternet

    ianternet Well-Known Member

    Messages:
    1,084
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    138
    #5
    I would use a php rotator as java scripts are bad for search engines - with php rotator u can get stats on which one gets clicks - I was usin java rotators but I went to php - lately I switch back to java because - CJ codes are java scripts - so I manually just took the codes and images and rotated them - but PHP rotating is far better for your site and search engines
     
    ianternet, Oct 19, 2006 IP
  6. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #6
    Got a link to some code for that?
     
    carl_in_florida, Oct 19, 2006 IP
  7. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #7
    for those who find this thread in the future here is what i found off of TOPS30's links.

    <script language="JavaScript">
    <!-- Begin
    rnd.today=new Date();
    rnd.seed=rnd.today.getTime();
    
    function rnd() {
            rnd.seed = (rnd.seed*9301+49297) % 233280;
            return rnd.seed/(233280.0);
    };
    
    function rand(number) {
    	var result = Math.ceil(rnd()*number);
    	if (!result)result++;
            return result
    };
    var ad_cnt1 = 3;
    var ad1 = rand(ad_cnt1);
    var link1;
    var adBanner1;
    var width1
    var height1
    if (ad1==1) {
    link1="http://url1.com";
    adBanner1="http://image1.com/1.gif";
    width1="160";
    height1="600";
    alt1="first image";
    }
    if (ad1==2) {
    link1="http://url1.com";
    adBanner1="http://image1.com/2.gif";
    width1="160";
    height1="600";
    alt1="number 2";
    }
    if (ad1==3) {
    link1="http://url1.com";
    adBanner1="http://image1.com/1.gif";
    width1="160";
    height1="600";
    alt1="number 3";
    }
    document.write('<center><a href="' + link1 + '" target="_blank">');
    document.write('<img src="' + adBanner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '"></a>');
    document.write('</center>');
    // End -->
    </SCRIPT>
    
    Code (markup):
     
    carl_in_florida, Oct 19, 2006 IP
  8. Abundant1

    Abundant1 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I am trying to get some text and links to rotate, and my script isn't even showing ANY text. Can I modify this script to rotate just text? How would I do that?

    Any takers?
     
    Abundant1, Oct 21, 2006 IP
  9. Blame Me

    Blame Me Guest

    Messages:
    162
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I use this http://www.bannercreator.nu/banner-rotation.html script for text on this site Golf In NYC.

    I had used it for images but changed it to use text.

    Its simple and it works.

    Hope this helps you :)
     
    Blame Me, Oct 21, 2006 IP
  10. ianternet

    ianternet Well-Known Member

    Messages:
    1,084
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    138
    #10
    hmm I want to try this code - it looks like you can add more than 5 - am I correct?
     
    ianternet, Oct 23, 2006 IP
  11. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #11
    You can add as many as you want but you have to modify

    var ad_cnt1 = 3;

    to the number of banners
     
    carl_in_florida, Oct 23, 2006 IP