开发者

How do I load Javascript within jQuery based tabs?

I have Jquery and CSS tab like this one and in the each tab I have facebook feed box, twitter widget, and my blog's ranking widget. BUT if I place these widg开发者_开发百科ets within the tab area content, each widgets stops working. How do I get these widgets to load with in these jQuery tabs?

My tabs: http://www.sohtanaka.com/web-design/examples/tabs/


Look at jQuery.getScript

$.getScript('js-url', function(){
    //the loading is completed
    //display button
});

Hope this helps!

Update:

$.getScript('http://platform.twitter.com/widgets.js', function(){ 
   //code 
});

Also, you can embed the iframe code version of twitter and facebook buttons instead of loading the js code each time, for example:

<iframe allowtransparency="true" 
        frameborder="0" 
        scrolling="no" 
        src="http://platform.twitter.com/widgets/tweet_button.html" 
        style="width:130px; height:50px;"></iframe>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜