3 <style type="text/css">
20 <script type="text/javascript">
27 window.onload = InitDragDrop;
28 function InitDragDrop() {
29 document.onclick = OnMouseClick;
30 document.getElementById('inv_slot1').onclick = OnMouseClick; document.getElementById('inv_slot2').onclick = OnMouseClick; document.getElementById('inv_slot3').onclick = OnMouseClick; document.getElementById('inv_slot4').onclick = OnMouseClick; document.getElementById('inv_slot5').onclick = OnMouseClick; document.getElementById('inv_slot6').onclick = OnMouseClick; document.getElementById('inv_slot7').onclick = Drop; document.getElementById('inv_slot8').onclick = Drop; document.getElementById('inv_slot9').onclick = Drop; document.getElementById('slot1').onclick = OnMouseClick; document.getElementById('slot2').onclick = OnMouseClick; document.getElementById('slot3').onclick = OnMouseClick; document.getElementById('slot4').onclick = OnMouseClick; document.getElementById('slot5').onclick = OnMouseClick; document.getElementById('slot6').onclick = OnMouseClick; document.getElementById('slot7').onclick = OnMouseClick; document.getElementById('slot8').onclick = OnMouseClick; document.getElementById('slot9').onclick = OnMouseClick; document.getElementById('slot10').onclick = OnMouseClick; document.getElementById('slot11').onclick = OnMouseClick; document.getElementById('slot12').onclick = OnMouseClick; document.getElementById('slot13').onclick = OnMouseClick; document.getElementById('slot14').onclick = OnMouseClick; document.getElementById('slot15').onclick = OnMouseClick; document.getElementById('slot16').onclick = OnMouseClick; document.getElementById('slot17').onclick = OnMouseClick; document.getElementById('slot18').onclick = OnMouseClick; document.getElementById('slot19').onclick = OnMouseClick; document.getElementById('slot20').onclick = OnMouseClick; document.getElementById('slot21').onclick = OnMouseClick; document.getElementById('slot22').onclick = OnMouseClick; document.getElementById('slot23').onclick = OnMouseClick; document.getElementById('slot24').onclick = OnMouseClick; document.getElementById('slot25').onclick = OnMouseClick; document.getElementById('slot26').onclick = OnMouseClick; document.getElementById('slot27').onclick = OnMouseClick; document.getElementById('slot28').onclick = OnMouseClick; document.getElementById('slot29').onclick = OnMouseClick; document.getElementById('slot30').onclick = OnMouseClick; document.getElementById('slot31').onclick = OnMouseClick; document.getElementById('slot32').onclick = OnMouseClick; document.getElementById('slot3').onclick = Drop; document.getElementById('slot4').onclick = Drop; document.getElementById('slot5').onclick = Drop; document.getElementById('slot6').onclick = Drop; document.getElementById('slot7').onclick = Drop; document.getElementById('slot11').onclick = Drop; document.getElementById('slot12').onclick = Drop; document.getElementById('slot13').onclick = Drop; document.getElementById('slot14').onclick = Drop; document.getElementById('slot15').onclick = Drop; document.getElementById('slot17').onclick = Drop; document.getElementById('slot18').onclick = Drop; document.getElementById('slot19').onclick = Drop; document.getElementById('slot20').onclick = Drop; document.getElementById('slot21').onclick = Drop; document.getElementById('slot22').onclick = Drop; document.getElementById('slot23').onclick = Drop; document.getElementById('slot24').onclick = Drop; document.getElementById('slot25').onclick = Drop; document.getElementById('slot26').onclick = Drop; document.getElementById('slot27').onclick = Drop; document.getElementById('slot28').onclick = Drop; document.getElementById('slot29').onclick = Drop; document.getElementById('slot30').onclick = Drop; document.getElementById('slot31').onclick = Drop; document.getElementById('slot32').onclick = Drop;
35 function OnMouseClick(e) {
36 if (_countClick == 0) {
39 var target = e.target != null ? e.target : e.srcElement;
40 if ((e.button == 1 && window.event != null || e.button == 0) && target.className == 'drag') {
41 _offsetX = ExtractNumber(target.style.left);
42 _offsetY = ExtractNumber(target.style.top);
43 _oldZIndex = target.style.zIndex;
44 target.style.zIndex = 10000;
45 _dragElement = target;
47 document.onmousemove = OnMouseMove;
48 document.body.focus();
49 document.onselectstart = function() { return false; };
50 target.ondragstart = function() { return false; };
51 if (!e) var e = window.event;
52 e.cancelBubble = true;
53 if (e.stopPropagation) e.stopPropagation();
54 _dragElement.parentElement.onclick = Drop;
60 if (_countClick == 1) {
63 var item = _dragElement.id;
66 var target = e.target != null ? e.target : e.srcElement;
69 _offsetX = ExtractNumber(target.style.left);
70 _offsetY = ExtractNumber(target.style.top);
72 if (_dragElement != null) {
73 _dragElement.style.zIndex = _oldZIndex;
74 document.onmousemove = null;
75 document.onselectstart = null;
76 _dragElement.style.left = _offsetX;
77 _dragElement.style.top = _offsetY;
78 _dragElement.ondragstart = null;
79 _dragElement.parentElement.onclick = null;
85 window.location = "include/inv_p.php?char=1&from=" + item + "&to=" + slot;
90 function OnMouseMove(e) {
94 // this is the actual "drag code"
95 _dragElement.style.left = (e.clientX) + 1;
96 _dragElement.style.top = (e.clientY) + 1;
99 function ExtractNumber(value) {
100 var n = parseInt(value);
101 return n == null || isNaN(n) ? 0 : n;
105 return document.getElementById(id);
108 function OnMouseUp(e) { }
116 <body topmargin="0" leftmargin="0">
117 <div style='position: relative; height: 400px; width: 256px; top: 0px; left: 0px;
118 background-color: #000000; color: White; z-index: 0; background: url(http://street-kings-online.com/files/bg.jpg) no-repeat left top;'>
119 </div><div id='inv_slot1_parent'>
120 <div id='inv_slot1' class='drag' style='width: 32px; height: 64px; top: 84px; left: 16px;
121 background: url(http://street-kings-online.com/sprites/items/c01_sword01.gif) no-repeat center top;'>
123 <div id='inv_slot2' class='drag' style='width: 64px; height: 64px; top: 84px; left: 176px;
124 background: url(http://street-kings-online.com/sprites/items/2_3.gif) no-repeat center top;'>
126 <div id='inv_slot3' class='drag' style='width: 64px; height: 64px; top: 10px; left: 96px;
127 background: url(http://street-kings-online.com/sprites/items/4_9.gif) no-repeat center top;'>
129 <div id='inv_slot4' class='drag' style='width: 64px; height: 64px; top: 190px; left: 16px;
130 background: url(http://street-kings-online.com/sprites/items/5_2.gif) no-repeat center top;'>
132 <div id='inv_slot5' class='drag' style='width: 64px; height: 96px; top: 84px; left: 96px;
133 background: url(http://street-kings-online.com/sprites/items/3_11.gif) no-repeat center top;'>
135 <div id='inv_slot6' class='drag' style='width: 64px; height: 64px; top: 190px; left: 96px;
136 background: url(http://street-kings-online.com/sprites/items/8_9.gif) no-repeat center top;'>
138 <div id='inv_slot7' class='slot' style='top: 42px; left: 48px; width: 32px; height: 32px;'>
140 <div id='inv_slot8' class='slot' style='top: 190px; left: 176px; width: 32px; height: 32px;'>
142 <div id='inv_slot9' class='slot' style='top: 190px; left: 208px; width: 32px; height: 32px;'>
144 <div id='slot1' class='drag' style='width: 32px; height: 64px; top: 272px; left: 0px;
145 background: url(http://street-kings-online.com/sprites/items/c01_sword01.gif) no-repeat center top;'>
147 <div id='slot2' class='drag' style='width: 32px; height: 64px; top: 272px; left: 32px;
148 background: url(http://street-kings-online.com/sprites/items/c01_sword01.gif) no-repeat center top;'>
150 <div id='slot8' class='drag' style='width: 32px; height: 64px; top: 272px; left: 224px;
151 background: url(http://street-kings-online.com/sprites/items/c01_sword01.gif) no-repeat center top;'>
153 <div id='slot1' class='slot' style='top: 272px; left: 0px;'>
155 <div id='slot2' class='slot' style='top: 272px; left: 32px;'>
157 <div id='slot3' class='slot' style='top: 272px; left: 64px;'>
159 <div id='slot4' class='slot' style='top: 272px; left: 96px;'>
161 <div id='slot5' class='slot' style='top: 272px; left: 128px;'>
163 <div id='slot6' class='slot' style='top: 272px; left: 160px;'>
165 <div id='slot7' class='slot' style='top: 272px; left: 192px;'>
167 <div id='slot8' class='slot' style='top: 272px; left: 224px;'>
169 <div id='slot9' class='slot' style='top: 304px; left: 0px;'>
171 <div id='slot10' class='slot' style='top: 304px; left: 32px;'>
173 <div id='slot11' class='slot' style='top: 304px; left: 64px;'>
175 <div id='slot12' class='slot' style='top: 304px; left: 96px;'>
177 <div id='slot13' class='slot' style='top: 304px; left: 128px;'>
179 <div id='slot14' class='slot' style='top: 304px; left: 160px;'>
181 <div id='slot15' class='slot' style='top: 304px; left: 192px;'>
183 <div id='slot16' class='slot' style='top: 304px; left: 224px;'>
185 <div id='slot17' class='slot' style='top: 336px; left: 0px;'>
187 <div id='slot18' class='slot' style='top: 336px; left: 32px;'>
189 <div id='slot19' class='slot' style='top: 336px; left: 64px;'>
191 <div id='slot20' class='slot' style='top: 336px; left: 96px;'>
193 <div id='slot21' class='slot' style='top: 336px; left: 128px;'>
195 <div id='slot22' class='slot' style='top: 336px; left: 160px;'>
197 <div id='slot23' class='slot' style='top: 336px; left: 192px;'>
199 <div id='slot24' class='slot' style='top: 336px; left: 224px;'>
201 <div id='slot25' class='slot' style='top: 368px; left: 0px;'>
203 <div id='slot26' class='slot' style='top: 368px; left: 32px;'>
205 <div id='slot27' class='slot' style='top: 368px; left: 64px;'>
207 <div id='slot28' class='slot' style='top: 368px; left: 96px;'>
209 <div id='slot29' class='slot' style='top: 368px; left: 128px;'>
211 <div id='slot30' class='slot' style='top: 368px; left: 160px;'>
213 <div id='slot31' class='slot' style='top: 368px; left: 192px;'>
215 <div id='slot32' class='slot' style='top: 368px; left: 224px;'>