This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

java image text

Discussion in 'Techie Discussion' started by Maljonic, Jan 17, 2004.

  1. Maljonic

    Maljonic Can't get enough of FH

    is it possible to do alt/title text for java script images, or what's the code for this?
     
  2. Jonty

    Jonty Fledgling Freddie

    Hi Maljonic

    What exactly do you mean by "javascript images"? If you mean image code that is generated by JavaScript, then you'll have to find where the code is generated in the script and modify it accordingly. If you post the code then I'm sure we can figure it.

    If you mean something else, then just post a little more detail.

    Kind Regards
     
  3. Maljonic

    Maljonic Can't get enough of FH

    Hi, this is a script for an ad banner

    <script language="JavaScript" src="http://impgb.tradedoubler.com/imp/10129/943728" charset="ISO-8859-1"></script>

    I wanted to know if I can get some text to appear when the mouse is over the banner, like when using the mouseover html code. Plus, as an afterthought; change the status bar text too. :)
     
  4. Jonty

    Jonty Fledgling Freddie

    Hi Maljonic

    If you insert 'title="My onmouseover title"' that should do the trick; e.g.


    Code:
    <script language="JavaScript" src="http://impgb.tradedoubler.com/imp/10129/943728" charset="ISO-8859-1" title="My onmouserover text"></script>
    That's not a great approach, but it will probably work. As for the status bar text, that's slightly trickier. I'll explain how it may be down if you really want ...

    Kind Regards
     
  5. Shovel

    Shovel Can't get enough of FH

    If you just want a static caption, you could put the <script> within a <div> and give the <div> a suitable title attribute. You could also add any mouseOver actions for Status Bar text to the div as well and it should work exactly the same.

    e.g.
    Code:
    <div id="adbanner" title="Please visit our sponsor!" onMouseOver="statusBar('Please visit our sponsor');">
      <script ...snip... </script>
    </div>
     
  6. Jonty

    Jonty Fledgling Freddie

    Good solution, Shovel :D

    Kind Regards

    Jonty

    P.S. Wouldn't we need an onmouseout to reset the status bar?
     
  7. Shovel

    Shovel Can't get enough of FH

    Yes, yes we would :)

    And just to stress as well, the "statusBar()" method I've used is just an example, you'd have to code that for yourself or use your own method, it was just to demonstrate where it would go :)
     
  8. Jonty

    Jonty Fledgling Freddie

    hehe, cool :) I think "window.status='Test'" is probably the easiest way to do it, although I dare say it flickers a bit. Say, as a hasty example ...


    Code:
    <div id="adbanner" title="Please visit our sponsor!" onmouseout="window.status='';" onmouseover="window.status='Please visit our sponsor';">
      <script ...snip... </script>
    </div>
    Kind Regards
     
  9. Maljonic

    Maljonic Can't get enough of FH

  10. Shovel

    Shovel Can't get enough of FH

    Do bear in mind that modern browsers like Firebird contain the option to disable changing the status bar text.
     
  11. Maljonic

    Maljonic Can't get enough of FH

    Of course, but most people use IE or Netscape. ;)
     
  12. Shovel

    Shovel Can't get enough of FH

    Netscape 6/7 also contain said option, they Mozilla and Firebird are all based on the same. But yes, for something as superficial as status bar text you can certainly rely on the IE masses.

    It's something to be aware of when bug bashing to be honest :) People who say "The text doesn't appear where you say it should" etc. ;)
     

Share This Page