javascript - stellar.js not working with dynamically loaded elements via AJAX -


i'm using fantastic stellar.js (http://markdalgleish.com/projects/stellar.js/) parallax on recent project, i've run challenge:

stellar isn't noticing when change content via ajax (in case loading in new div's html file , using jquery's replacewith method). so, new elements have no parallax, though have stellar data attributes.

i've tried calling .stellar function on window again after ajax complete, doesn't anything.

how can stellar correctly apply parallax new ajax'd in elements?

i know question posted long time ago has been accepted, me solution above did not work, wanted share worked me.

after ajax call has been successful can call stellar's refresh function so:

$.stellar('refresh'); 

here full code:

$.ajax({     type: 'get',     url: ajaxurl }).done(function(data) {      $(targetelement).html(data);      $.stellar('refresh');  }).fail(function() {      // else  }); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -