Here is my code
$(".inboxfeedlist li").hover(function(e){alert('');}
This is not working for dynamically created elements, even i have use
$(".inboxfeedlist li").bind('hover',function(){})
is also not working, what's problem with code.
Here is my code
$(".inboxfeedlist li").hover(function(e){alert('');}
This is not working for dynamically created elements, even i have use
$(".inboxfeedlist li").bind('hover',function(){})
is also not working, what's problem with code.
You could use something like this:
live
become deprecated at jQuery 1.9. We can useon
withmouseenter
andmouseleave
events instead:For some reason I can't use
hover
withon
. It simply doesn't work. But, from what I have read, hover is just an adaptation from mouseenter and mouseleave, so it is fine. (https://stackoverflow.com/a/4463384/1031340)If you do not need to support IE6, I recommend you use
:hover
on your CSS (if it is a change only in CSS, how example above).Use the live method:
A side note hover does take two callback functions, did you mean
mouseover
try live
Sounds like you need live or delegate. Delegate is prefered
Use
delegate
orlive
to bind the events. This will make sure anything added dynamically will be bound to the event handler as well.