Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

does the movement of a div on another div trigger onmouseover?

Status
Not open for further replies.

espilce

Programmer
Oct 29, 2009
3
0
0
TR
hello,

my question is here:

in javascript, does "the movement of a div onto another div" trigger onmouseover?

html codes are here:
Code:
<body>
<div id="moving" style="position:absolute;display:none">
vcbvbcv
</div>
<div id="fixed" style="position:absolute;" onmouseover="move('asil')" onmouseout="movetooldplace('asil')">
mouse</div>
</body>

here are js functions

Code:
function move(id){
    document.getElementById(id).style.display="block";
    if(document.getElementById(id).offsetLeft<200){
        document.getElementById(id).style.left=document.getElementById(id).offsetLeft+10;
        setInterval(function(){move(id);},25);
    }
}

function movetooldplace(id){
    
    if(document.getElementById(id).offsetLeft>0){
        var sayi=document.getElementById(id).offsetLeft;
        document.getElementById(id).style.left=sayi-10;
        setInterval(function(){movetooldplace(id);},10);
    }
    if(document.getElementById(id).offsetLeft==0){
        document.getElementById(id).style.display="none";
    }
    
}
as you see there are two function. one function (move) move the div to right, other function(movetotoldplace) move the div old place, to left. the matter is, div can not go to last left pixel. moving div can not move to last pixel passing through under other div(fixed)

i tried to see whether the functions work on their own. they are working if i do not use them together.

i am doing these for a horizontal slowly openning menu. what should i do to fix the problem?

thanks
 
...does "the movement of a div onto another div" trigger onmouseover?
No. Only the movement of the mouse over an element will trigger the onmouseover event being fired.

I don't know about all the other stuff you have posted... I just answered the question you asked.

If you are making a menu, consider using something like the Suckerfish menu solution. It's referenced from a lit of search engines, and is very well used on the 'net.

Cheers,
Jeff

[tt]Visit my blog [!]@[/!] Visit Code Couch [!]@[/!] [/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
thanks.
then, there is another problem in my code.
one more question:
if i use something like Suckerfish solution, must i write on somewhere on my site that i use suckerfish?
thanks
 
its now ok!

hope it will continue to work fine in future!
thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top