Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
What's wrong with this (mouse coordinates)
Old 08-30-2009, 10:52 PM What's wrong with this (mouse coordinates)
Super Talker

Posts: 132
Trades: 0
Code:
document.onmousemove  = function (event) {
    if (!event) {
    event = window.event;
    }
    var x = event.clientX;
    var y = event.clientY;
    
    var a = document.getElementById('a');
    var b = document.getElementById('b');
    var c = document.getElementById('c');
    var d = document.getElementById('d');
    var f = document.getElementById('f');
    
    var box = document.getElementById('buttonsBox');
    
    a.addEventListener('mouseover', function(e) {
        box.style.display = 'block';
        box.style.top = x;
        box.style.left = y;
    }, true);
    
    b.addEventListener('mouseover', function(e) {
        
    }, true);
    
    c.addEventListener('mouseover', function(e) {
        
    }, true);
    
    d.addEventListener('mouseover', function(e) {
        
    }, true);
    
    f.addEventListener('mouseover', function(e) {
        
    }, true);
}
it gets the x and y but doesn't put 'buttonBox' where i want it.
soap is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to What's wrong with this (mouse coordinates)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.38843 seconds with 12 queries