Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    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

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    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>

  • #5
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #7
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Might it be a browser 'security' thing to stop sites from being able to hide their true url?

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •