tags:

views:

51

answers:

1

I have a weird kind of problem.I have hover event on DIV .On run time i have to insert some elements in to DIV .Hover event should not happen after inserting div elements.But problem is if i hover on DIV before inserting elements in to the DIV .Hover event is getting carried after inserting the elements.I tried removing attribute its not working for me...

Please let me know If you have a solution

A: 

As gmcalab said, please provide some code.

But, a wild shot from here. Since a class is always applied to an element, no matter the state of that element. Maybe you can write a little javascript to change the class of the DIV after you're done.

<div id="yourdiv" class="foo">

You do your things and finally call:

document.getElementById('yourdiv').className = 'bar';

Then in css something like

.bar:hover { background:#EDEDED; or-whatever-styling:you-need;}

But then again, without a codesample it's a hard guess...

Ben Fransen