Discussion:
hiding and showing the DIV on mouse enter
Shahzad
2010-02-01 10:31:21 UTC
Permalink
I want to attach a controls DIV with parent DIV so when mouse is over
the parent DIV then it should show the controls DIV and when mouse
leaves the DIV then it should hide the DIV just like
http://www.350.com/pe see that the controls div get activated when
mouse is over the object div.

we try to solve this by having the DIV inside each object and when
MouseEnter then we show the controls and when MouseOut then we hide
the div. but its not working. one strange behavioue we saw then
when we have mouse pointer on the edge of the div then it is
continuously firing the mouseenter event nonstop. don't understand
why. see the attached file

any other way is most welcome we just want to simulate the
http://www.350.com/pe behaviour



Shahzad
Ben Campbell
2010-02-01 13:47:31 UTC
Permalink
Firstly, just a warning that this is a first post.

I've had a look at the link, and it seems to be redirecting me back to
the homepage, however, I would think that to produce the effect you
want you should just be able to use find(). so the following should
work:

$(document).ready(function() {
$('.divParent').hover(function() {
$(this).find('.divControl').show();
},funtion() {
$(this).find('.divControl').hide();
});

});

The alternative would be to use addClass and removeClass, with a
display:none on the default, and a display:block on the added class.

Hope this helps anyway.

Ben
Post by Shahzad
I want to attach a controls DIV with parent DIV so when mouse is over
the parent DIV then it should show the controls DIV and when mouse
leaves the DIV then it should hide the DIV       just likehttp://www.350.com/pe  see that the controls div get activated when
mouse is over the object div.
we try to solve this by having the DIV inside each object and when
MouseEnter   then we show the controls and when MouseOut then we hide
the div.  but its not working.     one strange behavioue we saw then
when we have mouse pointer on the edge of the div then it is
continuously firing the mouseenter event nonstop.   don't understand
why.      see the attached file
any other way is most welcome   we just want to simulate thehttp://www.350.com/pe  behaviour
Shahzad
Loading...