0

I have setup the cycle plugin on my page and im calling dynamic content into the page through ajax. I'm then putting this content into a div and then running the plugin. The problem is that it will work perfectly when loading the page sometimes and then when I refresh the page it will not load at all.

Any suggestions?

    $.ajax({
  url: "http://www.site.co.uk/cgi-bin/latest-instructions-2.pl",
  success: function(html){
    $("#slider").html(html);
  }
});
$('#slider').cycle({ 
    fx: 'scrollLeft',
    cleartype: true,
        cleartypeNoBg: true,
        pager: '#li-number2',
        requeueOnImageNotLoaded: true  
});
Olly
  • 1

1 Answers1

0

I managed to figure out what I was doing wrong, the slider was running before the page had loaded I simply added a window onload function as so...

$(window).bind("load", function() {
$('#slider').cycle({ 
    fx: 'scrollLeft',
    cleartype: true,
        cleartypeNoBg: true,
        pager: '#li-number2',
        requeueOnImageNotLoaded: true  
});
});
Olly
  • 1