java image text

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
is it possible to do alt/title text for java script images, or what's the code for this?
 

Jonty

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,411
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
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
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. :)
 

Jonty

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,411
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
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
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>
 

Jonty

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,411
Good solution, Shovel :D

Kind Regards

Jonty

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

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
Jonty said:
Good solution, Shovel :D

Kind Regards

Jonty

P.S. Wouldn't we need an onmouseout to reset the status bar?
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 :)
 

Jonty

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,411
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
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
Do bear in mind that modern browsers like Firebird contain the option to disable changing the status bar text.
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
Shovel said:
Do bear in mind that modern browsers like Firebird contain the option to disable changing the status bar text.
Of course, but most people use IE or Netscape. ;)
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
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. ;)
 

Users who are viewing this thread

Top Bottom