Results 1 to 6 of 6

Thread: link?

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448

    link?

    how can i make a link that moves down and to the left when your mouse moves over it?

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    You can move a hyperlink but its easier to put it in a layer..

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <title>Untitled</title>
    <script language="JavaScript" type="text/javascript">
    <!--
    function findleft(objectID){
        if (findDom(objectID).left){return findDom(objectID).left;}
        if (findDom(objectID).pixelLeft){return findDom(objectID).pixelLeft;}
        if (findDom(objectID).offsetLeft){return findDom(objectID).offsetLeft;}
        return 'null';
    }
    
    function findtop(objectID){
        if (findDom(objectID).top){return findDom(objectID).top;}
        if (findDom(objectID).pixelTop){return findDom(objectID).pixelTop;}
        if (findDom(objectID).offsetTop){return findDom(objectID).offsetTop;}
        return 'null';
    }
    
    function findDom(objectID){
       if (document.all){
           return document.all(objectID);
       } else if (document.getElementById){
           return document.getElementById(objectID);
       } else if (document.layers){
           return (document.layers[objectID]);
       }
    }
    //-->
    </script>
    
    </head>
    <body>
    <span style="position:absolute; left:50px; top:50px;" id="link1" onmouseover="this.style.left=findleft('link1')-10;this.style.top=findtop('link1')+10;"><a href="javascript://">This is a link</a></span>
    </body>
    </html>
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    that wasnt it. its supposed to move down and to the left and come back after you come off the link

  4. #4
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    So we tab to it, or just disable the JavaScript. Is there a reason behind silly browser tricks, Muk?

    Punk, I would use a div instead of a span. The div is supposed to be the block layer, the span is meant to be inline. 'Course, either will technically work, it's just a matter of convention.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    i just think it looks cool i think it might be a java but im not sure

  6. #6
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Punk, I would use a div instead of a span
    Good Point, <div> would be better
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

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



Click Here to Expand Forum to Full Width