0
点赞
收藏
分享

微信扫一扫

一个小巧的文章关键词jquery TIPS插件


今天看到一个简单化的老外搞的jquery TIPS插件。所谓的tips插件,就是在文章中的某些关键字词,当用户鼠标点到它们上面时,自动弹出窗口来个详细说明。
这个插件这里下载,叫tweets tooltip,下载地址是
​​​http://jquery.malsup.com/twitter/ ​​​
使用方法简单,比如下面的这个是关键字:
<span class="twitter_search">Some search term</span>
然后引入该插件js后,这样使用就可以了:

$(function() {  


$('#article').find('.twitter_search').twitterpopup();


});


其中,#article是父容器的id,至于弹出窗口的内容,该插件是通过JSON回调的
形式实现的,具体代码到:http://tympanus.net/Development/LatestTweetsTooltip/LatestTweetsTooltip.zip
下载,
其中关键的部分,在这里,留意下载代码中的jquery.twiter.search.js中的

$.fn.twitterSearch.defaults = { 

url: 'http://search.twitter.com/search.json?callback=?&q=',

anchors: true, // true or false (enable embedded links in tweets)

animOutSpeed: 500, // speed of animation for top tweet when removed

animInSpeed: 500, // speed of scroll animation for moving tweets up

animOut: { opacity: 0 }, // animation of top tweet when it is removed

applyStyles: true, // true or false (apply default css styling or not)


这里是要打开的URL的设置和其他一系列的设置

举报

相关推荐

0 条评论