Link to home
Start Free TrialLog in
Avatar of itortu
itortuFlag for United States of America

asked on

show alt text, or tooltip

I have an html page with a javascript function that that displays images inline, and also another function that whne the user clicks on the image a bigger image is opened (provided by EE)  what I would like to know is, how can text can be shown one the mouse passes over the image?

the text i want to display is "Click image to enlarge"

Thank you in advance.



<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <title>Radar</title>
  <link class="header" href="stylePage.css" rel="stylesheet" type="text/css" media="all" />

  <script language="javascript">

  function newWindow(filename) {
         window.open (filename, 'bw', 'toolbar=yes, directories=yes, location=yes, status=yes, menubar=yes, resizable=yes, scrollbars=yes, width=1024, height=728');
    }
   function changeImage(filename, clickLink)
   {
        document.mainimage.src = filename;
        document.mainimage.onclick = function () { newWindow(clickLink);}
   }
</script>
 </head>
 <body leftmargin="0" marginheight="0" marginwidth="0" topmargin="0" >
  <div class="header">MAPS</div>
  <table width="100%" border="0" cellspacing="1" cellpadding="2">
   <tr>
    <td class="radars"><a href="javascript:changeImage('http://files.world.com/max_s.jpg', 'http://www.world.com/Global/category.asp?c=6264');" class="radars">Doppler</a></td>
    <td class="radars"><a href="javascript:changeImage('http://files.world.com/w_desktop_images/metro_nexrad_tracks.jpg', 'http://www.world.com/global/link.asp?l=123654');" class="radars">Metro</a></td>
    <td class="radars"><a href="javascript:changeImage('http://files.world.com/w_desktop_images/sandmtn_nexrad_tracks.jpg', 'http://www.world.com/global/link.asp?l=119747');" class="radars">Sand NEXRAD </a></td>
    <td class="radars"><a href="javascript:changeImage('http://files.world.com/w_desktop_images/rad_tracks.jpg', 'http://www.world.com/global/link.asp?l=119847');" class="radars">NEXRAD</a></td>
   </tr>
   <tr>
    <td align="center" width="1"><img src="images/spacer.gif" alt="" height="240" width="1" border="0"></td>
    <td colspan="4" align="center">
    <img id="mainmap" src="http://files.world.com/max_s.jpg" name="mainimage" border="0" onclick="window.open('http://www.world.com/Global/category.asp?c=5550');" /><br><font size="1">Click to enlarge</font></td>
   </tr>
 </table>
 </body>


</html>
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Like this:
<img id="mainmap" src="http://files.world.com/max_s.jpg" name="mainimage" border="0" onclick="window.open('http://www.world.com/Global/category.asp?c=5550');" alt="Click to enlarge"/>

Avatar of itortu

ASKER

that only works using IE isn't rigth?

Thank you.
Avatar of itortu

ASKER

what would be the solution for FF as well?
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The title= produces tooltip in IE and FF.
The alt= is only placeholder before image arives. In IE it is also used for tooltip/title.

Avatar of itortu

ASKER

excellent!

thank you very much.

You are welcome.