I'm using one of the jQuery tickers within my new project and pages are loaded using the HTML5 History API (pushState and popState). Once the page content has been loaded using jQuery.getJSON() I get a warning saying 'Element does not exist in DOM!' - and I believe it is referring to the ticker container (returned after ajax call) as it doesn't work after content has loaded.
I've tried to instantiate the ticker again in the jQuery.getJSON()'s callback function, but this didn't resolve the problem:
jQuery.getJSON(url, function(data) {
jQuery.each(data, function(k, v) {
$('#' + k + ' section').fadeOut(200, function() {
$(this).replaceWith($(v).hide().fadeIn(200));
});
});
$('ul#feedNews').ticker({
speed: 0.10,
controls: true,
titleText: '<strong>Latest news</strong>',
displayType: 'reveal',
direction: 'ltr',
pauseOnItems: 3000,
fadeInSpeed: 600,
fadeOutSpeed: 300
});
});
Any idea what would be the solution?