Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / January 2007



Tip: Looking for answers? Try searching our database.

Help with Alt for pics

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paulie "Walnut" Gualtieri - 30 Jan 2007 19:11 GMT
Hi all,
I have this code, to create a slideshow:

<script language="JavaScript1.1">
<!--
//preload images
var img0=new Image()
img0.src="http://mypath.jpg"
img0.alt="MyPictureDescription"
...
//other pictures definition
//-->
</script>

then, in the body:

<script>
<!--
var step=0
var whichimage=1
function slideit(){
if (!document.images)
return
//If the browser is IE 4.x
if (document.all)
  slide.filters.blendTrans.apply()
  document.images.slide.src=eval("img"+step+".src")
  document.images.slide.alt=eval("img"+step+".alt")
//If the browser is IE 4.x
if (document.all)
  slide.filters.blendTrans.play()
  whichimage=step
  if (step<13)
    step++
  else
    step=0
setTimeout("slideit()",4000)
}
</script>

For some reason, Explorer shows pictures and tooltip (pic description when
you mouse it over) as well,
Firefox does not.
Is there a way I can change the code so that Firefox will show the tooltips?

thanks
pcx99 - 30 Jan 2007 20:15 GMT
use title="description" this works in ANY tag not just images.   IE's
approach is considered non-standard.  Note that for images you'll still
need to supply ALT tags (it's required for validation services) but if
you want descriptive popups in anything other than explorer you'll need
to supply a title in addition to an alt attribute.

Hope this helps out a bit.

> Hi all,
> I have this code, to create a slideshow:
[quoted text clipped - 42 lines]
>
> thanks

Signature

http://www.hunlock.com -- Musings in Javascript, CSS.
$FA

Randy Webb - 30 Jan 2007 23:12 GMT
Paulie "Walnut" Gualtieri said the following on 1/30/2007 2:11 PM:
> Hi all,
> I have this code, to create a slideshow:

Trash it and find a better script.

document.all does *not* mean it is IE4. Try testing your script in
Opera.....

eval is useless in that script.
javascript1.1
<!-- //-->

Yuck!
Signature

Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.