Advertisement
Guest User

Untitled

a guest
May 30th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. https://jsfiddle.net/xInfinityMing/9vmw4mtc/6/
  2.  
  3. <div id="dragIcons">
  4. <img width="100px" height="100px" src="assets/img/gebiz.png">
  5. <img width="100px" height="100px" src="assets/img/b2b.png">
  6. <img width="100px" height="100px" src="assets/img/pitches.png">
  7. <img width="100px" height="100px" src="assets/img/creative.png">
  8. </div>
  9. <div id="briefcase">
  10. <div id="briefcase-droppable">
  11. </div>
  12. </div>
  13.  
  14. .draggable
  15. {
  16. filter: alpha(opacity=100);
  17. opacity: 1.0;
  18. z-index: 100;
  19. transition: none !important;
  20. animation: pulse 0.4s alternate infinite;
  21. }
  22. .end-draggable
  23. {
  24. animation: 0;
  25. }
  26. .dropped
  27. {
  28. position: static !important;
  29. transition: none !important;
  30. animation: 0;
  31. }
  32. #dragIcons
  33. {
  34. padding: 5px;
  35. min-height: 100px;
  36. width: 500px;
  37. margin-left: auto;
  38. margin-right: auto;
  39. }
  40. #briefcase
  41. {
  42. height: 485px;
  43. width: 600px;
  44. margin-left: 300px;
  45. background: url("../../../assets/img/folder.png");
  46. background-position:
  47. background-repeat: no-repeat;
  48. position: absolute;
  49. }
  50. #briefcase-open
  51. {
  52. height: 485px;
  53. width: 600px;
  54. margin-left: 300px;
  55. background: url("../../../assets/img/folder-open.png");
  56. background-position:
  57. background-repeat: no-repeat;
  58. position: absolute;
  59. }
  60. #briefcase-droppable
  61. {
  62. border-style: solid;
  63. height: 285px;
  64. width: 450px;
  65. margin-left: 80px;
  66. margin-top: 110px;
  67. }
  68. @keyframes pulse {
  69. 100% {
  70. transform: scale(1.1);
  71. }
  72. }
  73.  
  74. $(function () {
  75. $("#dragIcons img").draggable({
  76. revert: "invalid",
  77. refreshPositions: true,
  78. drag: function (event, ui) {
  79. ui.helper.removeClass("end-draggable");
  80. ui.helper.addClass("draggable");
  81. },
  82. stop: function (event, ui) {
  83. ui.helper.addClass("end-draggable");
  84. ui.helper.removeClass("draggable");
  85. }
  86. });
  87. $("#briefcase-droppable").droppable({
  88. drop: function (event, ui) {
  89. if ($("#briefcase").length == 0) {
  90. $("#briefcase-droppable").html("");
  91. }
  92. ui.draggable.addClass("dropped");
  93. $("#briefcase-droppable").append(ui.draggable);
  94. }
  95. });
  96. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement