weebox使用教程汇总

以下是默认选项:

boxid: null, //设定了此值只后,以后在打开同样boxid的弹窗时,前一个将被自
动关闭

boxclass: null, //给弹窗设置其它的样式,用此可以改变弹窗的样式

type: 'dialog', //弹窗类型,目前有dialog,error,warning,success,wee,prompt,
box六种

title: '', //弹窗标题

width: 0, //弹窗宽度,不设时,会自动依据内容改变大小

height: 0, //弹窗高度(注意是内容的高度,不是弹窗的高度)

timeout: 0, //自动关闭的秒数,设置此值后,窗口将自动关闭

draggable: true,//是否可以拖拽

modal: true, //是否显示遮照

overlay: 75, //遮照透明度

focus: null, //弹窗打开后,焦点移到什么元素上,默认移到取消按钮到

position: 'center',//弹窗打开后的默认为中间,设置为element时,需要设置
trager选项,

trigger: null, //显示位置的参照元素,为一个元素id

showTitle: true,//是否显示标题

showButton: true,//是否显示按钮,包括确定和取消

showCancel: true, //是否显示取消按钮

showOk: true, //是否显示确定按钮

okBtnName: '确定',//"确定"按钮名称

cancelBtnName: '取消',//"取消"按钮名称

contentType: 'text',//内容获取方式,目前有三种text,selector,ajax

contentChange: false,//为selector时

clickClose: false, //点击不在弹窗上时,是否关闭弹窗

zIndex: 999,//默认弹窗的层

animate: false,//效果显示

onclose: null, //弹窗关闭时触发的函数

onopen: null, //弹窗显示前触发的函数, 此时内容已经放入弹窗中,不过还没有显
示出来

onok: null //点击确定按钮触发的函数


基本用法


使用前需包含以下jquery.js、bgiframe.js、weebox.js、wee.css文件

基本用法举例如下: $.weeboxs.open('#testbox', {title: 'hello world', width:
400, height: 200});

$.weeboxs.open('The operation failed.',{
onopen:function(){alert('opened!');},
onclose:function(){alert('closed!');}, onok:function(){alert('ok');
$.weeboxs.close();} });

$.weeboxs.open('/modules/test/testsession.php', {contentType:'ajax'});

$.weeboxs.open('hello world');

$.weeboxs.open('The operation failed.',{type:'error'});

$.weeboxs.open('The operation failed.',{type:'wee'});

$.weeboxs.open('The operation failed.',{type:'success'});

$.weeboxs.open('The operation failed.',{type:'warning'});

$.weeboxs.open('Autoclosing in 5 seconds.', { timeout: 5 });


不起作用解决方案

前提:在我的网页中添加了以下引用
jquery.js
jquery.validate.js
写了以下脚本
弹出窗口脚本:
$.weeboxs.open('#EditProject', {
title:"新增项目",
modal:true,//默认为true
draggable:true,//默认为true
//position:{refele:this},
animate:true,
timeout:0,//默认为0
width:430,
height:280

});
**********************************************************
验证脚本
<script language="javascript" type="text/javascript">
$().ready( function() {
$("#form1").validate({
rules: {
txtPrjCode: {required: true,email: true},
txtPrjName: {required: true, minlength:
2},
txtBeginDate:{required:true,date:true},
txtEndDate:{required:true,date:true}
},
messages: {
txtPrjCode:{required: "项目编号不能为
空!",email:"Email 格式不正确"},
txtPrjName: "项目名称不能为空!",
txtBeginDate:"开始日期不能为空!",
txtEndDate:"结束日期不能为空!"
}
});

});
</script>
************************************************
现象:
1:当DIV没有被弹出前,验证方法起作用.
2:当DIV使用$.weeboxs.open()方法弹出后,验证方法将不在起作用.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值