By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,196 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

javascript cycling graphic does not work on MAC IE

P: n/a
1. robbiehe...@gmail.com Sep 19, 1:48 pm show options

From: robbiehe...@gmail.com - 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/...uates&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 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <11*********************@g44g2000cwa.googlegroups. com>,
ro*********@gmail.com 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]
Sep 20 '05 #2

P: n/a
Sandman <mr@sandman.net> 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.
Sep 20 '05 #3

P: n/a
<ro*********@gmail.com> wrote in message news:11*********************@g44g2000cwa.googlegro ups.com...
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.

Sep 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.