基于jquery的头像弹出框插件JSPOP配置说明

代码一共6k,基于jquery的头像弹出框实现,实现弹出信息的定位、信息配置、样式定义。

1.下载地址:http://code.google.com/p/jspop/downloads/list

2.demo地址:http://wuzhi.me/jspopupdemo.php

3.配置说明:

var setting = {
// 过滤弹窗字段 当该字段为notpopup时不做弹出 如:<a href="/u/@" filter="notpopup"></a>
filter:'filter',
// 返回可以作为弹窗关键子的字段
filterfunction:function(url){
key = url.replace(/\/u\/@/g,"");
return key;
},
// 500毫秒以内仍然在才触发弹出
hideDelay:500,
// 填充数据的url
ajaxurl:'',
// 弹窗关键字
key:'key',
// 弹窗ID前缀,确保唯一
idpre:'jspopup_',
// 弹窗class,确保唯一
mainclass:'jspopup',
//等待提示
loadingmsg:'loadding....',
//预计高度,用来判断弹出的上下方位
yj360,
//预计宽度,用来判断弹出的左右方位
yjheight:60,
//写在弹出框内的方法,xml为ajaxurl返回的数据
createhtml:function(xml){
return "<br><br>"+xml+"<br><br>";
}
};

4.页面代码

1)样式表及js

<link href="../css/pop.css" rel="stylesheet"/>
<script type="text/javascript" src="../js/jspop.js" ></script>

2)覆盖默认配置项
//所有的a都支持弹窗,获取数据的url改为/data.php ,等待提示改为:等待中

$('a').each(function(){$(this).jspop({'ajaxurl':'/data.php','loadingmsg':'等待中..'});});</script> 

欢迎提供意见和建议。邮箱:1286514442@qq.com

转:http://wuzhi.me/?p=65

原文地址:https://www.cnblogs.com/shuaixf/p/2318985.html