Changeset 37533
- Timestamp:
- 2023-03-17T16:44:58+13:00 (7 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/tabletop-dl/trunk/tabletop.html
r37467 r37533 18 18 <script src="winbox-dist/js/winbox.min.js"></script> 19 19 --> 20 <link rel="stylesheet" href="src/winbox-with-interactjs/dist/css/winbox.min.css"> 21 <script src="src/winbox-with-interactjs/dist/js/winbox.min.js"></script> 20 22 21 23 <script src="interactjs-dist/interact.min.js"></script> … … 81 83 82 84 </div> 85 86 <!-- 87 <div id="my-own-window" 88 style="position: absolute; left: 30px; top: 430px; width: 400px; height: 300px; background-color: red;"> 89 </div> 90 --> 83 91 92 84 93 </div> 85 94 <div class="row footer" style="display:none;"> … … 105 114 }); 106 115 }); 116 117 118 const win = new WinBox({ 119 id: "my-winbox", 120 title: 'My Window2', 121 width: '400px', 122 height: '400px', 123 }); 124 125 interact('#my-winbox') 126 .draggable({ 127 // enable inertial throwing 128 inertia: true, 129 // keep the element within the area of it's parent 130 modifiers: [ 131 interact.modifiers.restrictRect({ 132 restriction: 'parent', 133 endOnly: true 134 }) 135 ], 136 // enable autoScroll 137 autoScroll: true, 138 139 listeners: { 140 // call this function on every dragmove event 141 move: dragMoveListener, 142 143 // call this function on every dragend event 144 end (event) { 145 var textEl = event.target.querySelector('p') 146 147 textEl && (textEl.textContent = 148 'moved a distance of ' + 149 (Math.sqrt(Math.pow(event.pageX - event.x0, 2) + 150 Math.pow(event.pageY - event.y0, 2) | 0)) 151 .toFixed(2) + 'px') 152 } 153 } 154 }); 155 107 156 }); 108 157
Note:
See TracChangeset
for help on using the changeset viewer.