...

View Full Version : CSS and popuplink problem



Teppic
06-08-2007, 09:14 AM
Hey all!

I've defined my link in my .css as such:
A:link
{
FONT-WEIGHT: bold;
FONT-SIZE: x-small;
COLOR: #3399cc;
text-decoration: underline;
FONT-FAMILY: Verdana, Arial, Helvetica, 'Times New Roman'
}
A:visited
{
FONT-WEIGHT: bold;
FONT-SIZE: x-small;
COLOR: #3399cc;
text-decoration: underline;
FONT-FAMILY: Verdana, Arial, Helvetica, 'Times New Roman'
}
A:hover
{
FONT-WEIGHT: bold;
FONT-SIZE: x-small;
COLOR: #ffffff;
text-decoration: underline;
FONT-FAMILY: Verdana, Arial, Helvetica, 'Times New Roman'
}


But then when i use a popup through javascript:
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>

And then use a link such as:
<a href="#" onclick="MM_openBrWindow('http://www.link.com','link','width=300,height=160')">LINK</a>

Something happens that i don't want to happen which is that whenever i press the link the popup works alright, but my page jumps up to the top aswell!! i'm thinking this is because i used a # in the link, but if i don't do that the link is not 'seen' as a link and the stylesheet doesn't make it 'look' like a link.

Could someone please tell me how to solve this?

ahallicks
06-08-2007, 09:16 AM
Use #n, it won't jump to the top

_Aerospace_Eng_
06-08-2007, 09:46 AM
Use #n, it won't jump to the top

Only because it can't find an anchor with id="n" on the page. The correct thing to do is to add return false after the function call. This prevents the link from going anywhere.

Bill Posters
06-08-2007, 10:49 AM
Better yet, make the link accessible to those without js…

<a href="http://www.link.com" onclick="MM_openBrWindow(this.href,'link','width=300,height=160'); return false;">LINK</a>

Teppic
06-08-2007, 12:47 PM
many thanks guys! solved!

Now the popup works smoothyl except for that i can't seem to remove the adress bar from my popup window.
I tried using various 'location' commands and tried the dreamweaver behaviour command to turn it off, yet it still shows while all the rest (toolbar and such) are gone. Any idea?

_Aerospace_Eng_
06-08-2007, 08:45 PM
many thanks guys! solved!

Now the popup works smoothyl except for that i can't seem to remove the adress bar from my popup window.
I tried using various 'location' commands and tried the dreamweaver behaviour command to turn it off, yet it still shows while all the rest (toolbar and such) are gone. Any idea?

location=0 or location=no should work according to the documentation for IE http://msdn2.microsoft.com/en-us/library/ms536651.aspx

Bill Posters
06-08-2007, 09:04 PM
Might it be a browser 'security' thing to stop sites from being able to hide their true url?

_Aerospace_Eng_
06-08-2007, 10:01 PM
Usually the url will still display in the title bar.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum