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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    layer follows mouse

    can somone tell me how to make a layer that is always under the mouse pointer?

    If anyone has any ideas about how to make that layer always on top of all the other layers, that would be helpful, too.

    I BELIEVE by using this method i can fix the problem i'm having with the drag function crapping out when my mouse moves over another iframe in this script

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i am not sure, try this
    Code:
    <style>
    .class { position: relative; cursor:pointer
    }
    </style>
    <layer id="class">

  • #3
    Regular Coder
    Join Date
    Dec 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    not so much

    I appreciate the effort but even i could tell that wasnt gunna work! heh I think you might have misunderstood me. I want a layer that is always under the mouse pointer.. i've seen about the same effect in mouse trail effect scripts, unfortunately i'm slightly too stupid to see how they work exactly. The code i'm looking for i'm positive is full of a buncha annoying document.onmousemove ****.

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Ummm:

    <style type="text/css">
    #mouse {
    position: absolute;
    left: 0;
    top: 0;
    }
    </style>

    Then:

    document.onmousemove = function(evt) {
    var el = (document.getElementById || document.all)('mouse');
    el.style.left = window.event ? event.x : evt.clientX;
    el.style.top = window.event ? event.y : evt.clientY;
    }

    And:

    <div id="mouse">something</div>

    Or something like that, I didn't test it or anything.


  •  

    Posting Permissions

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