延迟功能 - jQuery

时间:2012-01-27 09:52:04

标签: jquery function delay

我同时使用Tweet和Truncate插件,所以如果推文太长就会在x字符后被截断。

$().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');
  }

});

...所以tweet函数会加载推文,但是jquery找不到它!是否可以延迟下一个功能,以便找到它?

由于

2 个答案:

答案 0 :(得分:1)

jquery有一个延迟函数http://api.jquery.com/delay/

答案 1 :(得分:0)

JQuery中有一种延迟方法,但更好的解决方案是在tweet回调方法中截断。

相关问题