jquery:binding a hover event with ajax loaded content -


I'm trying and some new loaded & lt; Li & gt; code> .hower () and I'm stuck at this time I have a & Ul & gt; I reload content in and .overover (); on & lt; There is a hover event on li & gt; . The hover event works perfectly on the non-ajax-loaded material of the course.

I know that I can use the mouseover / mouseout to bind to .live (); Which is a good solution if you were not for mouseover / mouseout , then there is bad habit to break the event if you have a child element of the current element The mouse moves despite the reason why I .over (); because I can independently arrange children of my hover-bound element,

dam (); does not work at all, so my question is ... Is there any advantage in trying to load AJAX & lt; Li & gt; Event bound and hover effect hover (); Keep it as , or I should just roll and mouseover / mouseout live ();

Success message:
  Success: function (data) {$ ('ul # list) '). Tie () .andend ("
  • Test Test "); }
  • works like a bind like

      $ ('# List') Bind ('mouseover', function () {})  

    However, I think what you should do is just call the function that you use to bind the event , When the document is first loaded. If it is inside a document ready block, then remove it in a single function and just call for the doctor and call the same function in the event of Ajax success. For example

      $ (document) .ready (function () (bandhover ($ ('# list & gt; li')) $ .ajax ({ Success: Functions (data) {bandhover (data.fund ('li')}}, url: blai});} function bindhor ($ liList) {$ liList.hover (fn, fn)}  

    Comments

    Popular posts from this blog

    c++ - Linux and clipboard -

    What is expire header and how to achive them in ASP.NET and PHP? -

    sql server - How can I determine which of my SQL 2005 statistics are unused? -