Forum Moderators: open

Message Too Old, No Replies

javascript link

open window and chnage text link colour

         

soapystar

1:19 pm on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Currently i use the following code:

<span class="popup" onClick='javascript:window.open("www.somepage.com","blank","toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=yes,")'><font size="2" color="#000080"><b>text goes here</b></font></span>

the popup class turns the cursor into a hand. What id like this link to do is turn the text into color : #FF0000 with an underline to make it work like normal html links and return to normal on mouseout. However using
onMouseOver="style.color='#FF0000';" onMouseOut="style.color='#000080;"

i cant get it to work. Is it this actually possible?

Thanks!

encyclo

1:31 pm on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried?:

onmouseover="[b]this.[/b]style.color='#ff0000';" onmouseout="[b]this.[/b]style.color='#000080';"

Bernard Marx

6:28 pm on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




<style>
a.popup,
a.popup:visited
{
font-size:x-small;
font-weight:bold;
color:#000080;
}
a.popup:hover {color:#ff0000;}
</style>
..........
<a class="popup"
href = "www.somepage.com" target="blank"
onclick="window.open('www.somepage.com','blank','toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=yes,');return false;">
text goes here</a>



All the usual...

- href link for JS-disabled browsers
- Use CSS pseudo-classes for rollovers (no script needed)
- No <font> tags

How's about setting the width & height for the popup?

:)

soapystar

6:34 pm on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



encyclo
cant get that to work

Bernard Marx
thanks, looks like what i needed!

BTW what does the return false do?

Bernard Marx

7:09 pm on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> stops the main page following the href link if JS is enabled.
(Try it without. See what happens)

PS encyclo's version should work too.