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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.