Orbit/public/desktop_widgets/school_events/school_events.js

21 lines
543 B
JavaScript

var eventsjson = new Array;
var loadEvents = function(){
$.getJSON(o.widgetfolder+"/school_events/events.json",function(events){
$.each(events,function(i,event){
eventsjson.push(event);
})
displayevents();
})
}
var i = 0;
var displayevents = function(){
// $("#school_events").fadeOut(1000);
$("#s_date").text(eventsjson[i].date);
$("#s_event").text(eventsjson[i].event);
$("#s_timings").text(eventsjson[i].timing);
// $("#school_events").fadeIn(1000);
if(i==eventsjson.length-1)i=0;
i++
setTimeout(displayevents,2000);
}