shafi_363
01-09-2006, 11:45 PM
Hi,
I am taking help of coordinates for Drag & drop operation between 2
list boxes Since mouseup event was not helping me in giving the target
element( HTML OPTION Element on which the mouse has been released)
Right now i am calculating the index (at which the dragged item has
to be inserted) by event.clientX, event.clientY. And then
(offset of List box) - ( event.clientY)
index= ---------------------------------------
(height of each item)
This is working in all conditions, except when the list box
contains more items than its size. Because then scrollbar comes into
picture. Then my calculation is going wrong. Is there any remedy to
find the correct index even when there is scroll bar.
Exceptional case:
================
If i specify the size of list box as 10. and then i put 20
items in that list box. Then scroll bar appears. Drag that scrollbar
completely down. Then it will show last 10 items. And after dragging
the item from other list box to this , i released my mouse on 13 th
item. then the item should be inserted at 14 th position. BUT FOR ME
ITS INSERTING AT 4 TH POSITION.
Can anyone guide me to come out of this problem !!!
Thanks a lot
--Shafi
I am taking help of coordinates for Drag & drop operation between 2
list boxes Since mouseup event was not helping me in giving the target
element( HTML OPTION Element on which the mouse has been released)
Right now i am calculating the index (at which the dragged item has
to be inserted) by event.clientX, event.clientY. And then
(offset of List box) - ( event.clientY)
index= ---------------------------------------
(height of each item)
This is working in all conditions, except when the list box
contains more items than its size. Because then scrollbar comes into
picture. Then my calculation is going wrong. Is there any remedy to
find the correct index even when there is scroll bar.
Exceptional case:
================
If i specify the size of list box as 10. and then i put 20
items in that list box. Then scroll bar appears. Drag that scrollbar
completely down. Then it will show last 10 items. And after dragging
the item from other list box to this , i released my mouse on 13 th
item. then the item should be inserted at 14 th position. BUT FOR ME
ITS INSERTING AT 4 TH POSITION.
Can anyone guide me to come out of this problem !!!
Thanks a lot
--Shafi