0e1053f86be3bfa8f128c966aec2b899299e1e0c.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. %>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <!--框架必需start-->
  9. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  10. <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
  11. <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
  12. <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  13. <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/"/>
  14. <link rel="stylesheet" type="text/css" id="customSkin"/>
  15. <!--框架必需end-->
  16. <!--拖拽组件start-->
  17. <script type="text/javascript" src="<%=path%>/libs/js/drag/dragDrop.js"></script>
  18. <!--拖拽组件end-->
  19. <!--布局控件start-->
  20. <script type="text/javascript" src="<%=path%>/libs/js/nav/layout.js"></script>
  21. <!--布局控件end-->
  22. <script type="text/javascript">
  23. function initComplete(){
  24. var layout=$("#layout1").layout({ leftWidth: 100,rightWidth:100,allowLeftCollapse:false,allowRightCollapse:false});
  25. $('.iconItem').find("img").each(function(){
  26. $(this)[0].ondragstart=function(){
  27. return false;
  28. }
  29. })
  30. $('.iconItem').find("img").each(function(){
  31. var dragObj=$(this);
  32. var drag = $(this).dragDrop({ revert: true , receive: '#centerContent'});
  33. drag.bind('StartDrag', function ()
  34. {
  35. this.cursor ="url(<%=path%>/libs/images/formEle/cursor_wrong.cur),auto"
  36. });
  37. //当进入区域时
  38. drag.bind('DragEnter', function (receive, source, e)
  39. {
  40. var maxNum=$(receive).find("img").length;
  41. if(maxNum>9){
  42. this.cursor ="url(<%=path%>/libs/images/formEle/cursor_wrong.cur),auto"
  43. }
  44. else{
  45. this.cursor ="url(<%=path%>/libs/images/formEle/cursor_right.cur),auto"
  46. }
  47. });
  48. //在区域移动
  49. drag.bind('DragOver', function (receive, source, e)
  50. {
  51. // $(receive).find(".message").html("在区域移动 " + e.pageX + ":" + e.pageY);
  52. });
  53. //离开区域
  54. drag.bind('DragLeave', function (receive, source, e)
  55. {
  56. this.cursor ="url(<%=path%>/libs/images/formEle/cursor_wrong.cur),auto"
  57. });
  58. //在区域释放
  59. drag.bind('Drop', function (receive, source, e)
  60. {
  61. var maxNum=$(receive).find("img").length;
  62. if(maxNum<10){
  63. var newObj=$('<img style="position:absolute;"/>')
  64. newObj.attr("src",dragObj.attr("src"));
  65. newObj.css({
  66. "left":source.offset().left-$(".layout_content").width(),
  67. "top":source.offset().top
  68. })
  69. $(receive).append(newObj);
  70. source.hide();
  71. if(dragObj.attr("removeable")=="true"){
  72. dragObj.parent().remove();
  73. }
  74. newObj[0].ondragstart=function(){
  75. return false;
  76. }
  77. }
  78. });
  79. })
  80. }
  81. </script>
  82. <style>
  83. .iconItem li{
  84. width:100px;
  85. height:80px;
  86. text-align:center;
  87. }
  88. </style>
  89. </head>
  90. <body>
  91. <div id="layout1">
  92. <div position="left" style="" panelTitle="复制型">
  93. <div class="layout_content">
  94. <ul class="iconItem">
  95. <li><img src="<%=path%>/libs/icons/png_64/01.png"/></li>
  96. <li><img src="<%=path%>/libs/icons/png_64/02.png"/></li>
  97. <li><img src="<%=path%>/libs/icons/png_64/03.png"/></li>
  98. <li><img src="<%=path%>/libs/icons/png_64/04.png"/></li>
  99. <li><img src="<%=path%>/libs/icons/png_64/05.png"/></li>
  100. <li><img src="<%=path%>/libs/icons/png_64/06.png"/></li>
  101. </ul>
  102. </div>
  103. </div>
  104. <div position="center" id="centerContent">
  105. 提示:此区域设置了最多容纳10个图标。
  106. </div>
  107. <div position="right" style="" panelTitle="移动型">
  108. <ul class="iconItem">
  109. <li><img src="<%=path%>/libs/icons/png_64/07.png" removeable="true"/></li>
  110. <li><img src="<%=path%>/libs/icons/png_64/08.png" removeable="true"/></li>
  111. <li><img src="<%=path%>/libs/icons/png_64/09.png" removeable="true"/></li>
  112. <li><img src="<%=path%>/libs/icons/png_64/10.png" removeable="true"/></li>
  113. <li><img src="<%=path%>/libs/icons/png_64/11.png" removeable="true"/></li>
  114. <li><img src="<%=path%>/libs/icons/png_64/12.png" removeable="true"/></li>
  115. </ul>
  116. </div>
  117. </div>
  118. </body>
  119. </html>