2952 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+10 more
DDStudios says

Hey guys, here is what I have :

These tweets are pulled from the twitter api and everything work well, what I want to do, is to make it so I only have 1 visible and then it cycle trough all of the tweets (slide down) and go back to the first one and then continue the cycle.

How would you guys do it?

Thanks!

Dany

2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says
I would do it with an Interval:
var current = 0,
 timebetween = 5000, 
count = $('.tweet_list li').length,
interval = setInterval(function(){

  setCurrentActiveAndHideLast(current);

  (count>=current)?current++:current=0;
},timebetween);
2952 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+10 more
DDStudios says

Is it supposed to hide the other tweets?

Nothing happened.

2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says

hehe, you have to make a setCurrentActiveAndHideLast function :D

Here the whole script (untested)


var current = 0, //start at 0 (first)
    last, // define for the last
    timebetween = 5000, //time between
    tweets = $('.tweet_list li'), //jquery object with all tweets
    count = tweets.length, //tweet count

//intervall
interval = setInterval(function(){

    //call action
    setCurrentActiveAndHideLast(current);
    //action is called set the last to the current
    last = current;
    //if current reach the tweetcount start with the first one again
    (count>=current)?current++:current=0;
},timebetween);

//hide all tweetd
tweets.hide();

function setCurrentActiveAndHideLast(current){
    //show the current
    tweets.eq(current).slideDown();
    //and hide the last if set
    if(last != null)tweets.eq(last).slideUp();
}
2952 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+10 more
DDStudios says

Nope doesn’t work, probably something I’m doing wrong.

I’m always confused about this kind of stuff ..

Sorry mate.

65 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
WebDesignPlanet says

By the way, if there is nothing more than UL inside “tweet” div, you can probably get rid of the latter and apply CSS directly to the UL. Best practice is to avoid “divitis”, i.e. too many empty nested divs. But you probably know this already.

2196 posts
  • Located in Europe
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Participated in a focus group or interview to improve the user experience on Envato Market
+10 more
revaxarts says

Nope doesn’t work, probably something I’m doing wrong.

I’m always confused about this kind of stuff ..

Sorry mate.

Ok I fiddled it out. it was a little tricky but now it should work

2588 posts Put a Donk On It
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has sold $250,000+ on Envato Market
+10 more
ThemeProvince says

Thats one attractive twitter feed ;)

2952 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+10 more
DDStudios says


Nope doesn’t work, probably something I’m doing wrong.

I’m always confused about this kind of stuff ..

Sorry mate.
Ok I fiddled it out. it was a little tricky but now it should work

That’s awesome.

Do you have Skype? I would have some stuff to ask you that i’m to embarassed to ask here lol

edit Found you, added you. ;)

2254 posts Digital Artist
  • Had an item featured in a magazine
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has referred 200+ members
+12 more
crozer says

Just remember that jQuery Cycle is also your friend :D

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by