eozzy
eozzy

Reputation: 68680

Delay function - jQuery

I'm using Tweet and Truncate plugin simultanously, so if the tweet it too long it gets truncated after x chars.

$().ready(function() {

  $(".tweets").tweet({
    join_text: "auto",
    username: "dave",
    avatar_size: 18,
    count: 1,
    auto_join_text_default: "",
    loading_text: "Loading tweet..."
  });

  if ( $('.tweet_text')[0] ) { 
    alert('yay');
  }

});

... so the tweet function loads the tweet, but jquery doesn't find it! Is it possible to delay the next function so it can find it?

Thanks

Upvotes: 0

Views: 242

Answers (2)

Mikael Härsjö
Mikael Härsjö

Reputation: 1036

There is a delay method in JQuery however a better solution would be to truncate in the tweet callback method.

Upvotes: 0

Scott
Scott

Reputation: 21882

jquery has a delay function http://api.jquery.com/delay/

Upvotes: 1

Related Questions