The FCS runs as soon as you call featuredcontentslider.init(), any additional DIVs you add to the slider afterwards won't be properly recognized by the script. Looking at your code it seems to be asynchronous- in that case, you might try initializing the slider only after having finished adding the DIVs to it dynamically, such as:
Code:
(function() {
var url = "http://xxxxxx";
var apiKey = "XXXXXXXXX";
$.getJSON(url + apiKey).done(function(data) {
$.each( data.sports[0].leagues[0].events, function() {
var score = $("<div/>", {class: "contentdiv"}).html('<table>' + '<tr>' + '<td>' + this.competitions[0].competitors[1].team.name + '</td>' + '</tr>' + '<tr>' + '<td>' + this.competitions[0].competitors[0].team.name + '</td>' + '</tr>' + '</table>');
$(score).appendTo($(".sliderwrapper"))
});
// initialize slider with your own settings:
featuredcontentslider.init({
id: "slider2", //id of main slider DIV
contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
toc: "markup", //Valid values: "#increment", "markup", ["label1", "label2", etc]
nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide.
revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
enablefade: [true, 0.2], //[true/false, fadedegree]
autorotate: [false, 3000], //[true/false, pausetime]
onChange: function(previndex, curindex, contentdivs){ //event handler fired whenever script changes slide
//previndex holds index of last slide viewed b4 current (0=1st slide, 1=2nd etc)
//curindex holds index of currently shown slide (0=1st slide, 1=2nd etc)
}
})
});
Bookmarks