您的位置:首页 > Web前端 > JQuery

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

2013-07-01 16:24 387 查看
今天看到一个简单化的老外搞的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的设置和其他一系列的设置
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: