jQuery event not working after load

Posted by Shina on Pro Webmasters See other posts from Pro Webmasters or by Shina
Published on 2012-06-28T08:25:19Z Indexed on 2012/06/28 9:23 UTC
Read the original article Hit count: 154

Filed under:

$(document).ready(function(){

$(function() {
    $('a.ajaxload').live('click', function(e) {           
      var url = $(this).attr('href');
      $('#desktopcontainer').load(url); // load the html response into a DOM element
      e.preventDefault(); // stop the browser from following the link
    });
});

$(function() {
    $(".accordion .accordion-tabs .tab").each(function(){
        $(this).click(function(){
            if ($(this).hasClass('tab')){
            $(this).removeClass('tab');
            $(this).addClass('active');
          }else{
            $(this).removeClass('active');
                    $(this).addClass('tab');
          }

          $(this).next().slideToggle('slow');
                return false;
        });
    });
}); 

});

My tab works fine but after I click the "a.ajaxload" to add a content to the page, then my tab doesn't respond anymore.

Can anyone please tell me where the problem is?

Thank you in advance.

© Pro Webmasters or respective owner

Related posts about jQuery