longtone Posted April 29, 2010 Share Posted April 29, 2010 Using jQuery and AJAX, I am filling a div ' #pic_frame ', by calling a js function 'picShow()' picShow first resizes and hides some images, then it calls a function 'append()' which appends some divs with overlay images, then it sets an Interval on a function 'slideshow()' On first loading the page this all works, but on reloading '#pic_frame' with AJAX, everything works except 'append()' I know .live is probably the answer, I just can't see how to use it I've tried: $("#pic_frame").live('load', function(){ append(); }); but no joy does anyone know how I get this to work? the thing that confuses me is why setInterval works, but not simply calling a function Link to comment https://forums.phpfreaks.com/topic/200123-ajax-and-jquery-problem-using-live/ Share on other sites More sharing options...
longtone Posted April 29, 2010 Author Share Posted April 29, 2010 I've found an answer: setInterval does not work, it's already running before the AJAX so it carries on I used a callback after the AJAX function to run the same functions that run when the page is loaded seems to solve the problem Link to comment https://forums.phpfreaks.com/topic/200123-ajax-and-jquery-problem-using-live/#findComment-1050481 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.