CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2013
    Posts
    1

    JavaScript (Banner Rotator) Simple Fix

    Hey guys,

    I am new here and am not sure if this is the right place to my question but was in need of help... I have looked everywhere but cannot find the answer. I have a code made from a machine from the info that I put in (pics, links, and etc) to make me a banner rotator for my website, but the images display in random order. Is there anyway to modify the coding, so that they can show one after another? Rather than showing randomly...

    Thanks for whoever helps me. I greatly appreciate it.

    heres the code....


    <script type="text/javascript"><!--
    /*
    Copyright 2013 The PCman Website Rotating Banner Code
    http://www.thepcmanwebsite.com
    This code is free to use provided this notice is not removed.
    Create your own custom banner code with banners
    */
    mybanners=
    [
    "<a href=\"http://mcdonalds.com/\"><img src=\"http://behance.vo.llnwd.net/profile...3807295/824cb16aeae0e30e67882a688d7849f4.gif\" width=\"249\" height=\"300\" alt=\"mcdonalds\" border=\"0\"></a>",
    "<a href=\"http://freelancer.com/\"><img src=\"http://www.abeconsultancy.co.uk/sit...tures/freelancer_co_uk-banner-300x250-01.gif\" width=\"250\" height=\"300\" alt=\"Freelancer\" border=\"0\"></a>",
    "<a href=\"http://bodybuilding.com/\"><img src=\"http://www.dreamdzines.com/images/banner14.jpg\" width=\"250\" height=\"300\" alt=\"BodyBuilder\" border=\"0\"></a>"
    ]
    randomNumber = Math.random()
    var show_mybanners = mybanners[Math.floor(randomNumber * mybanners.length)]
    document.write(show_mybanners);
    // --></script>
    <noscript>
    <a href=\"http://bodybuilding.com/\"><img src=\"http://www.dreamdzines.com/images/banner14.jpg\" width=\"250\" height=\"300\" alt=\"BodyBuilder\" border=\"0\"></a>
    </noscript>

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: JavaScript (Banner Rotator) Simple Fix

    [ Moved Thread to the Client Side Scripting Forum ]
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured