method added to autocycle through sponsors based on sponsor level and code added to inherit twitter env variables
This commit is contained in:
parent
881518f1f3
commit
e8d3177ec1
14 changed files with 89 additions and 163 deletions
|
|
@ -1,21 +1,32 @@
|
|||
$(document).ready(function() {
|
||||
// will call refreshCurrentEvents every 15 minutes
|
||||
setInterval(refreshCurrentEvents, 900000)
|
||||
// To cycle through tweets
|
||||
var tweets = $('div[id^="tweet"]').hide();
|
||||
var i = 0;
|
||||
setInterval(refreshCurrentEvents,900000);
|
||||
|
||||
(function cycle() {
|
||||
tweets.eq(i).show(0)
|
||||
.delay(5000)
|
||||
.hide(0, cycle);
|
||||
i = ++i % tweets.length;
|
||||
})();
|
||||
// Only show the first child of tweet and sponsor containers on page load
|
||||
$('#tweet-container').children().hide();
|
||||
$('#tweet-container').children().eq(0).show();
|
||||
$('#sponsor-container').children().hide();
|
||||
$('#sponsor-container').children().eq(0).show();
|
||||
|
||||
});
|
||||
setInterval(function(){ cycleVisibleElement($('#tweet-container'))}, 5000)
|
||||
setInterval(function(){ cycleVisibleElement($('#sponsor-container'))}, 10000)
|
||||
});
|
||||
|
||||
// Makes an ajax call for fresh data
|
||||
function refreshCurrentEvents(){
|
||||
$.ajax({
|
||||
url: "conference_wide_screen.js"
|
||||
});
|
||||
};
|
||||
|
||||
// Cycle through children in a container and toggles visibility
|
||||
function cycleVisibleElement(container){
|
||||
var childrens = $(container).children();
|
||||
for(var i = 0; i < childrens.length; i++ ){
|
||||
if(childrens.eq(i).is(":visible")){
|
||||
childrens.eq(i).hide();
|
||||
childrens.eq(++i % childrens.length).show();
|
||||
return
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue