jQuery events not happening after AJAX load?

前端 未结 8 685
别跟我提以往
别跟我提以往 2021-01-22 13:59

I have a website that will fade out a section of my website, load new content in, and fadeIn. There\'s a feature I had where a picture would get big when you click on it (it\'s

8条回答
  •  一整个雨季
    2021-01-22 14:38

    Delegate is a better option than Live. You can delegate to a higher level element. You can even do:

    $('body').delegate('.makePictureBig', 'click', function() {
      //code
    });
    

提交回复
热议问题