After jQuery page reload without refresh, animation is not working -


i need page reload without refresh function reset statement of animation. that's why tried reload

$('#wrapper').load('http://localhost:7002/myproj/home'); 

but, after reloading, jquery click functions not working. idea please? thanks

the below piece of code.. still need give function other 2 div. called div1 , div3.

$(".div2").mouseover(function () {     $('#pp').attr('src', '../../resources/images/aa.png');     if (cube.width() == 550) {         $('.imagediv').append(pp);     } }).mouseout(function () {     $('#pp').attr('src', '../../resources/images/bb.png');     pp.remove(); }).on("click", function (event) {      $('.div1, .div3').on('click', function () {            $('#cube').fadeto("slow", 1);            $('.imagediv').contents(':not("#cube")').remove();            $('#cube').animate({ width: '550px' }, 500);            $('#wrapper').load('/myproj/home');      });      $('.div2').unbind('mouseout');      $("#hp1,#hp2,#hp3,#hp4#").hide();      $('#cube').animate({ width: '700px' }, 500).fadeto("slow", 0.4);      $('#cube').animate({ 'margintop': "+=100px", 'marginleft': "-=100px" }, 'slow', function () {      $('.imagediv').append(p3d);      p3d.animate({ 'top': '-=10px' }, 'slow', function () {      $('.imagediv').append(plabel);      p3d.click(function (e) {             e.stoppropagation()             p3d.show();             plabel.show();      });       plabel.click(function (e) {             e.stoppropagation()             p3d.show();             plabel.show();;      });       $(document).click(function () {             $('#cube').fadeto("slow", 1);             $('.imagediv').contents(':not("#cube")').remove();             $('#cube').animate({ width: '550px' }, 500);      });       $('#wrapper').load('/myproj/home');   });    });    });  

try writing click function after load inside function below:

$('#wrapper').load('/myproj/home',function() {    $('#youridorclass').on('click',function(){     }); }); 

or

wrap document click below:

$(document).on('click','#youridorclass',function(){  }); 

one suggestion: not give full qualified path in load http://localhost:7002/myproj/home because path changes when upload server , no longer localhost:7002


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -