x-layui.js 829 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*弹出层*/
  2. /*
  3. 参数解释:
  4. title 标题
  5. url 请求的url
  6. id 需要操作的数据id
  7. w 弹出层宽度(缺省调默认值)
  8. h 弹出层高度(缺省调默认值)
  9. */
  10. function x_admin_show(title,url,w,h,full){
  11. if (title == null || title == '') {
  12. title=false;
  13. };
  14. if (url == null || url == '') {
  15. url="404.html";
  16. };
  17. if (w == null || w == '') {
  18. w=800;
  19. };
  20. if (h == null || h == '') {
  21. h=($(window).height()/2);
  22. };
  23. var index = layer.open({
  24. type: 2,
  25. area: [w+'px', h +'px'],
  26. fix: false, //不固定
  27. maxmin: true,
  28. shadeClose: true,
  29. shade:0.4,
  30. title: title,
  31. anim:-1,
  32. content: url
  33. });
  34. //layer.iframeAuto(index)
  35. if (full) {
  36. layer.full(index);
  37. }
  38. }
  39. /*关闭弹出框口*/
  40. function x_admin_close(){
  41. var index = parent.layer.getFrameIndex(window.name);
  42. parent.layer.close(index);
  43. }