javascript cycling graphic does not work on MAC IE

Discussion in 'Javascript' started by robbiehenry@gmail.com, Sep 20, 2005.

  1. Guest

    1. Sep 19, 1:48 pm show options

    From: - Find messages by this author
    Date: Mon, 19 Sep 2005 10:48:50 -0700
    Local: Mon, Sep 19 2005 1:48 pm
    Subject: javascript cycling graphic does not work on MAC IE
    Reply | Reply to Author | Forward | Print | Individual Message | Show
    original | Remove | Report Abuse

    I built this page for my company's corporate website
    (http://www.otpp.com/web/website.nsf/web/newgraduates&students)


    The second graphic down in the content area is a cycling graphic. Upon
    page reload one of 3 banner graphics randomly loads on the page.


    I works on all browsers that i can get my hands on for pc and mac
    except ie for mac.


    Can someone help me to figure out why it doesn't work and provide a
    solution for me?


    Thanks


    Here is the code


    jsheader:
    <script language="Javascript" type="text/javascript">
    <!-- Hide script from old browsers


    myPix = new
    Array("../web/bennertestimonial/$FILE/bennertestimonial.jpg","../web/cheung­testimonial/$FILE/cheungtestimonial.jpg","../web/ttrottestimonial/$FILE/ttr­ottestimonial.jpg")

    imgCt = myPix.length


    function choosePic() {
    if (document.images) {
    randomNum = Math.floor((Math.random() * imgCt))
    document.myPicture.src = myPix[randomNum]



    }
    }


    // End hiding script from old browsers -->
    </script>

    body tag:
    onload="choosePic()"


    image tag:
    <img src="../web/spacer/$FILE/spacer.gif" width="565" height="177"
    alt="" border="0" name="myPicture">
     
    , Sep 20, 2005
    #1
    1. Advertising

  2. Sandman Guest

    In article <>,
    wrote:

    > The second graphic down in the content area is a cycling graphic. Upon
    > page reload one of 3 banner graphics randomly loads on the page.
    >
    >
    > I works on all browsers that i can get my hands on for pc and mac
    > except ie for mac.



    Is IE for Mac important to you? It's ancient, and practically no one uses it
    anymore.

    --
    Sandman[.net]
     
    Sandman, Sep 20, 2005
    #2
    1. Advertising

  3. Sandman <> wrote:

    > Is IE for Mac important to you? It's ancient, and practically no one uses it
    > anymore.


    Unfortunately (for me at least), there are still people running Mac OS
    9 and below using IE 5.1.7; they occasionally bring its bloated
    carcass to our website, and I have to step carefully around its
    innumerable stupid quirks. Whether one wishes to cater to the
    wretched souls still running these browsers is a matter of personal
    taste, but they do exist.

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
     
    Christopher Benson-Manica, Sep 20, 2005
    #3
  4. <> wrote in message news:...

    >I works on all browsers that i can get my hands on for pc and mac
    >except ie for mac.


    I assume js and error reporting were enabled.

    When you reference an image, it's safer to do so via document.images
    but that may not be the problem.

    I suggest alerting the length of the array, the value returned by
    Math.random and the resolved source path:

    function choosePic()
    {
    if (document.images)
    {
    randomNum = Math.floor((Math.random() * imgCt))

    alert("myPix.length: "+myPix.length+'\n\nrandomNum: ' + randomNum +"\n\nsrc=" + myPix[randomNum]);

    document.images['myPicture'].src = myPix[randomNum];
    }
    }

    --
    S.C.
     
    Stephen Chalmers, Sep 20, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Thompson

    Write animated / cycling GIF's

    Andrew Thompson, Aug 3, 2005, in forum: Java
    Replies:
    4
    Views:
    4,136
    Andrew Thompson
    Aug 16, 2005
  2. 50 SOMETHING GAL
    Replies:
    3
    Views:
    423
  3. JoeC
    Replies:
    5
    Views:
    444
  4. JoeC
    Replies:
    1
    Views:
    332
  5. JoeC
    Replies:
    0
    Views:
    354
Loading...

Share This Page