Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-08-2007, 09:14 AM   PM User | #1
Teppic
New to the CF scene

 
Join Date: Jun 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Teppic is an unknown quantity at this point
CSS and popuplink problem

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?
Teppic is offline   Reply With Quote
Old 06-08-2007, 09:16 AM   PM User | #2
ahallicks
Senior Coder

 
ahallicks's Avatar
 
Join Date: May 2006
Location: Lancaster, UK
Posts: 1,134
Thanks: 1
Thanked 57 Times in 55 Posts
ahallicks is on a distinguished road
Use #n, it won't jump to the top
__________________
"write it for FireFox then hack it for IE."
Quote:
Originally Posted by Mhtml View Post
Domains are like women - all the good ones are taken unless you want one from some foreign country.
Reputation is your friend

Development & SEO Tools
ahallicks is offline   Reply With Quote
Old 06-08-2007, 09:46 AM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Quote:
Originally Posted by ahallicks View Post
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.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 06-08-2007, 10:49 AM   PM User | #4
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
Better yet, make the link accessible to those without js…
Code:
<a href="http://www.link.com" onclick="MM_openBrWindow(this.href,'link','width=300,height=160'); return false;">LINK</a>
Bill Posters is offline   Reply With Quote
Old 06-08-2007, 12:47 PM   PM User | #5
Teppic
New to the CF scene

 
Join Date: Jun 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Teppic is an unknown quantity at this point
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?

Last edited by Teppic; 06-08-2007 at 12:50 PM..
Teppic is offline   Reply With Quote
Old 06-08-2007, 08:45 PM   PM User | #6
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Quote:
Originally Posted by Teppic View Post
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
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 06-08-2007, 09:04 PM   PM User | #7
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
Might it be a browser 'security' thing to stop sites from being able to hide their true url?
Bill Posters is offline   Reply With Quote
Old 06-08-2007, 10:01 PM   PM User | #8
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Usually the url will still display in the title bar.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:50 PM.


Advertisement
Log in to turn off these ads.