Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<alt> tag in one line for 1 second in NS! Arrrgghhhhh! 1

Status
Not open for further replies.

TheDemon

Programmer
Feb 7, 2000
108
GB
How do I make my <ALT> tag descriptions appear in a box and stay up long enough for users to read?

In NS4 the <alt> tag appears as one line and is visible for about 1.5 seconds before it disappears.

As usual, I.E. does the job nicely.
 
alt = alternative only stay visible when the primary image or text is not visible, you will also notice alts show up in tool tips when users hang their mouse over the image.
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
Apologies for confusion - I meant tool tips. The tool tips (which is the alt tag in my code) doesn't stay up long enough in NS, and it only appears as one line (unlike I.E. which tidies it all up for me).

 
hmm, so you move your mouse over it, regardless of <br> and such in your alt, it shows for a sec then just disappears


Which version of netscape are you using?
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
This is in NS4 (Communicator 4.7)
You mentioned <br>. Is this relevant?
 
yea pretty much even in IE even tho IE will wordwrap your text, other browsers dont always, so treat your tooltip like HTML sometimes, inserting a <br> can force a caridge return at that point, very useful if you want to slow a list of items when moving mouse over.
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
I'm obviously doing something wrong, Karl. How do I insert a <br> tag in an <alt> tag?
 
well if you are using an image you dont use an <alt> alt is a property of an image tag

<img src=&quot;theimage.jpg&quot; alt=&quot;something<br>something<br>something&quot; width=&quot;20&quot; height=&quot;10&quot;>

so forth. so when you put your mouse over the image the text should look like

something
something
something

you can also throw in alt properties in <a href...> tags
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
Karl,

I've tried your suggestion in both IE and NS(4) and neither work. If you put the <br> tag within quotes it's treated as normal text.
 
hmmm

Code:
<img name=&quot;occ&quot; Src=&quot;images/buttons/English\tabs\occup_b.gif&quot; Border=&quot;0&quot; Alt=&quot;Occupation Includes:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Occupational Wages
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Occupational Projections
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Occupation/Industry Matrix
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Licensed Occupations
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Consumer Guide&quot; Vspace=&quot;0&quot; Hspace=&quot;0&quot; Align=&quot;left&quot;>

this person put carridge returns right in the source, so it's not <BR> but actually putting them in (by the way &amp;nbsp; is a space so they put in four or so spaces to make it look indented)
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
Ok. I made something else instead of alt, in order to let the msg appear more the 1 sec.It is more like a pop up of one line, near the link that is mouseoverd.You can choose which color you like there.Are you interested in the code I wrote for that?If you do, I'll post it later today or tomorrow.It works for ns but not in nn6 yet.
 
I guess I was based on dynamic drive. I don't remeber.
Anyway, I changed the ns part so it will satisfy me.
It fits IE + NS but not NS6. When I tried to use the &quot;alt&quot; attribute for ns6 as in IE, The alt worked but when I used too long text, it was cut, as if it started lefter then the left edge of the screen.
Here's the code and &quot;SO HELP U GOD&quot; - :)

<body>

<script>

if (!document.layers&amp;&amp;!document.all)
event=&quot;test&quot;
function popOn(current,e,text){

if (document.all){//IE
texti=text.split('<br>')
if (texti.length>1){
texts=''
for (i=0;i<texti.length;i++)
texts+=texti
current.title=texts
}
else
current.title=text
}



else if (document.layers){//NS
//document.info.document.write('<layer bgColor=&quot;white&quot; style=&quot;border:1px solid black;font-size:12px;&quot;>'+text+'</layer>')

document.info.document.write('<span>');
document.info.document.write('<table bgcolor=&quot;#f1f3ab&quot;><tr><td>');
document.info.document.write('<table bgcolor=&quot;#f1f3ab&quot; bordercolor=&quot;000000&quot; border=2><tr><td>');
document.info.document.write('<font face=&quot;arial&quot; size=&quot;-2&quot; face=&quot;arial&quot;>'+text+'</font>');
document.info.document.write('</td></tr></table>');
document.info.document.write('</td></tr></table>');
document.info.document.write('</span>');

document.info.document.close();
document.info.left=e.pageX+5;
document.info.top=e.pageY+5;
document.info.visibility=&quot;visible&quot;;
}
}
function popOff(){
if (document.layers)//NS
document.info.visibility=&quot;hidden&quot;
}

</script>
<div id=&quot;info&quot; style=&quot;position:absolute;visibility:hidden&quot;>
</div>
<table>
<tr>
<td><a href=&quot; onMouseover=&quot;popOn(this,event,'First link desc')&quot; onMouseout=&quot;popOff()&quot;>First link</a>
</td>
</tr>
<tr>
<td><a href=&quot; onMouseover=&quot;popOn(this,event,'Second link desc')&quot; onMouseout=&quot;popOff()&quot;>2nd link</a></td>
</tr>
</table>

<br>

</body>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top