« RCCTP Update – 11/13/07 | Main | Marching Band. Video Game. Where Could You Go Wrong? »
In which I let down dozens of people (maybe)…
By Brian | November 14, 2007 | Share on Facebook
I wound up working from home today, so I don’t have a live picture of the tree to share. But there is an update. Depending on your glass-is-half-empty/glass-is-half-full score, I’m sure you’ll conclude that I’m either very resourceful with the tools at my disposal, or a lousy, stinkin’ cheater.
Also, Jason Bennion pointed out to me in the comments from my last post that the oh-so-witty captions I’m putting on my posts are not available on Firefox, as they are on Internet Explorer. Given my limited skills with Javascript, I’m quite frankly surprised that Firefox can’t handle something I’ve written. Either I’ve written the code wrong, or Firefox breaks on the simplest of Javascript code.
For the geeks out there, here’s the relevant snippet. Any feedback? Also, if anyone knows how to set the alt text on the picture when it changes, let me know & I’ll do that. I don’t know off the top of my head and I don’t have time to Google it right now.
function Fade_Image(inc){
//Set fade speed
if (document.all){
document.images.imagetofade.style.filter=”blendTrans(duration=1)”
document.images.imagetofade.filters.blendTrans.Apply()
}//Load up next picture
curr_img = curr_img + inc
if (curr_img > (p-1)) curr_img=0
if (curr_img < 0) curr_img=p-1
document.images.imagetofade.src = preLoad[curr_img].src
caption.innerText=Cap[curr_img]//Do the Fade
if (document.all){
document.images.imagetofade.filters.blendTrans.Play()
}
}[…]
<td width=605 height=1000 valign=”top” align=”left” colspan=2>
<img src=”images/shim.gif” name=’imagetofade’ width=600 height=400 onclick=”Fade_Image(1)”><br>
<center><span id=”caption”>Topics: New York, New York, Tech Talk | 6 Comments »
6 Responses to “In which I let down dozens of people (maybe)…”


I get the captions in Safari, but I infer from your code that there’s supposed to be a transition effect, which there isn’t.
To quote a quick search: “Internet Explorer 4 introduced the document.all DOM (document object model) to allow access to the various parts of the web page. Soon after that the standard DOM method getElementById was introduced and is therefore available in all version 5+ browsers. This means that the document.all references are only needed to support IE4.
“Just about no one runs IE4 any more and so support for the document.all DOM is no longer required.”
But Safari seems to be doing better than Firefox, in that you at least see all of the content.
When I have some more time, I’ll google the DOM and see if there’s another variable I should be setting for Firefox. I can’t believe it doesn’t have the concept of captions at all – it’s probably just calling the variable something else.
Thanks for the field testing!
Anyway, I’m happy to update my code. Can you pass along the link to the page you found, or just tell me what the code should read that would make it Firefox friendly?
Also, I found in someone else’s question:
“One problem Mozilla complains about is “caption is not defined” at this line:
caption.innerText = NewCap[ImgNum];
document.slideshow.src = NewImg[ImgNum];
See if document.caption.innerText works any better. If not then you’ll need to use getElementById(“caption”).innerText.”
FamilyGreenberg.Com is proudly powered by WordPress.
The template is from RFDN and has been modified extensively by yours truly
Here is the RSS feed for the Entries and here is the RSS feed for the Comments