0

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

2
  • Does the Tweet plugin not have a callback function you can use to grab the tweet's content?
    – Labu
    Jan 27, 2012 at 9:57
  • possible duplicate of Jquery delay on function Jul 19, 2014 at 2:00

2 Answers 2

1

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

2
  • the delay function does work. Perhaps you should show what you tried.
    – Scott
    Jan 27, 2012 at 11:57
  • how should I use? can you please update the JS posted in the description? thanks!
    – eozzy
    Jan 27, 2012 at 13:26
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.