Skip to content

Instantly share code, notes, and snippets.

@LinuxDoku
Created August 1, 2010 17:37
Show Gist options
  • Save LinuxDoku/503559 to your computer and use it in GitHub Desktop.
Save LinuxDoku/503559 to your computer and use it in GitHub Desktop.
/**
* Slide between 3 tweets in 3 div's.
*
* @param int display The tweet to start
*/
function tweetSlider(display) {
if(display == 0) {
// hide tweets
$('#tweet_1').hide();
$('#tweet_2').hide();
}
// scroll out active tweet
active = display - 1;
if(active == -1) {
active = 2;
}
// PROPABLY BROKEN IN NEW JQUERY
//$('#tweet_' + active).hide("slide", { direction: "left", mode: 'hide' }, 500);
//$('#tweet_' + display).show("slide", { direction: "right", mode: 'show' }, 500);
// so we use this
$('#tweet_' + active).hide();
$('#tweet_' + display).fadeIn('slow');
next = display + 1;
if(next == 3) {
next = 0;
}
window.setTimeout("tweetSlider(" + next + ");", 6000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment