[jQuery] placing cycle plugin at root document level to use on content loaded via AJAX
I want to relocate my cycle plugin call from the file that is loaded
via an AJAX call to the parent file. I know I can't just copy, but not
sure what I need to do.
to illustrate;
put
$('#fcycle').cycle({
fx: 'fade',
timeout: 0,
speed: 'slow' ,
pager: '#qm0',
next: '#next',
prev: '#prev',
pagerAnchorBuilder: function(idx, slide) {
// return sel string for existing anchor
return '#qm0 li:eq(' + (idx) + ') a';
}
});
in my index.html
then I do this to load content
$sections.click(function(){
alert('test');
if( last != this ){ // let's avoid needless requests
var url = '' + this.hash.slice(1) + '.cfm';
$(this).html( '<div class="loading"><img src="images/
ajaxLoader.gif" /></div>' ).load( url, function(){
this.scrollLeft = 0;//scroll back to the left
});
}
last = this;
this.blur(); // Remove the awful outline
return false;
});
and I want the cycle function to affect content that is loaded (this)
Thanks