deerchao的blog

Be and aware who you are.

2008年4月1日

jQuery.popup

Document

requires:
<script type="text/javascript" src="jquery-1.2.3.min.js"></script> <script type="text/javascript" src="jquery.dimensions.pack.js"></script> <script type="text/javascript" src="jquery.popup.js"></script> --------------- example: $('<p>some tooltip here.</p>').popup('this is title.', $('#source'), {widht:200}, {close:'timeout'}); --------------- $.fn.popup = function(title, element, location, closeType, classes){...} --------------- title string, title text of popup --------------- element element, the element that popup's position is based on --------------- location width, height integer, size of the popup space integer, space between element and popup vertical string, one of 'default', 'below', 'above', 'middle' horizontal string, one of 'left', 'right', 'center', 'default' --------------- closeType close string, one of 'timeout', 'mouseout', 'click', 'closeButton' delay integer, when using 'timeout', how long before hiding element element, when using 'mouseout', 'click', the event source element --------------- classes popup string, class of the whole popup title string, class of the title closeButton string, class of the close button content string, class of tooltip content

Example

This is a basic example. Move mouse over this.

$(function(){
    $('#basic').mouseover(function(){ 
        $('#tip').popup('',$('#basic'),{},{close:'timeout',delay:1000}); 
    });
}); 

Another Example

This is another example. Click here to show/hide the popup.

$(function(){ 
    $('#ex2').click(function(){ 
        $('#tip').popup('This is the title.', $('#ex2'), {space:20, vertical:'above', height:50}, {close:'click'}); 
    });
}); 

Example 3

This is a third example.span#show

$(function(){ 
    $('#show').click(function(){ 
        $('<p>inline popup content.</p>').popup('a title', $('#adv'), {width:300}, {close: 'closeButton'}); 
    }); 
});

Download

Click here to download.

By: deerchao

posted @ 2008-04-01 15:45 deerchao 阅读(527) | 评论 (0)编辑

<2008年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

导航

统计

公告

给网络添加价值,就是让自己增加价值.

本博客所有内容,均为原创或对互联网已有资源的再加工,希望对你有用.在声明原作者的前提下,你可以任意使用,但本人对其正确性,使用的后果等不做任何担保,也不负任何责任.

正则表达式30分钟入门教程 v2.21 2007-8-3

I Want Spec#!

与我联系

搜索

 

常用链接

留言簿(66)

我管理的小组

我的标签

随笔档案(127)

文章分类(9)

文章档案(9)

新闻档案(9)

Links

积分与排名

最新评论

评论排行榜