I am creating a plugin and got something problems:
in the case:
I have a list of un-list created by ajax loaded .such as :
<ul id='ulist'>
<li>list 1</li>
<li>list 2</li>
<li>list 3</li>
</ul>
then li were binded with hover event when they loaded. such as :
$('ul').bind('hover',function(){});
but my plugin had a function to dynamic adding new li item to the ul[id='ulist'] which had been loaded.and the new li didn't get the hover event binding.Such as:
addNewLi : function(){
$('<li />').html('item N').appendTo('#ulist');
}
So,I knew I should bind the new dynamic created elements by 'live',but I don't know where to put it or have other way ....
Thank you very much!!