jBox的使用

jBox的使用下载地址 https github com StephanWagne jBoxNoticeva newjBox Notice overlay false color green attributes x left

Notice

var box = new jBox('Notice', { overlay: false, color: "green", attributes: { x: 'left', y: 'top' }, autoClose: false, content: "正在拉取分类……" });

autoClose可以是毫秒时间,false表示显示调用box.close()

Modal

页面

 
  

js

productList.editBox = new jBox('Modal', { closeButton: 'title', title: "编辑商品", content: $("#itemContainer"),//页面元素 display:none draggable: 'title',//可以拖动 width: 750, height: 260, maxWidth: 750, maxheight: 260, closeOnClick: false, ajax: { url: '/admin/getitem', data: { itemid: productId }, dataType: "json", type: "POST", reload: 'strict', setContent: false, success: function (response) { if (response && response.item) { productList._initItem(response.item); } else { productList.editBox.close(); new jBox('Notice', { overlay: false, color: "black", attributes: { x: 'left', y: 'top' }, autoClose: 2000, content: "商品不存在" }); } } }, onclose: function () { productList.editBox = null; } }).open();

productList.editBox = new jBox('Confirm', { content: $("#itemContainer"), adjustTracker: false, adjustPosition: false, reposition: false, draggable: 'title', width: productList._eidtBoxSize.width, height: productList._eidtBoxSize.height, maxWidth: productList._eidtBoxSize.width, maxheight: productList._eidtBoxSize.height, closeButton: 'title', attributes: { x: 'left', y: 'top' }, position: { x: 'center', y: 'center' }, title: '编辑商品', closeOnConfirm:false, cancelButton: '关闭', confirmButton: '保存', confirm: function () { productList._saveProduct(); }, ajax: { url: '/admin/getitem', data: { itemid:productId }, dataType: "json", type:"POST", reload: 'strict', setContent: false, success: function (response) { if (response && response.result) { productList._initProductInfo(response.result); } else { productList.editBox.close(); new jBox('Notice', { overlay: false, color: "black", attributes: { x: 'left', y: 'top' }, autoClose: 3000, content: "服务器忙,请稍后重试" }); } }, error: function () { productList.editBox.close(); new jBox('Notice', { overlay: false, color: "black", attributes: { x: 'left', y: 'top' }, autoClose: 3000, content: "服务器忙,请稍后重试" }); } } }).open(); //open需要显示调用




版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/225343.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 上午9:33
下一篇 2026年3月17日 上午9:33


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号