After using .loadto update my div, this is to add an item to my list, I used firebug and saw that the list was updated. However, I lost the mouseover event, which triggered the first time the page was loaded .... in my js script I have:
function openList(){
$("#miniList").removeClass().addClass("show");
}
function closeList(){
$("#miniList").removeClass().addClass("hide");
}
...
$(document).ready(function() {
$("#miniList").mouseover(function() {
openList();
})
$("#miniList").mouseout(function() {
closeList();
})
});
function addItemToDiv(id, ref, num) {
$("#miniList").load("/list/ajax_updateList.jsp", {
'action' : 'additem',
'pid' : id,
'pref' : ref,
'qty' : num
});
}
... Of course, this works great the first time the page loads, but when I add an item to the list, the DOM is updated, but the mouseover effects no longer work.
Any thoughts are more than welcome. Thank you very much in advance.
source
share