One more thing I forgot to mention earlier.

When I did the initial test I first played around with having just a 1px space 
(a hole, if you will, on the helper) at cursor location, but this didn't really 
work since the mouse (and therefore event.target) would overlap the helper, 
especially with rapid movements. Therefore I left a bufferzone by only creating 
borders for the helper and not getting too close to the mouse pointer. A few px 
might be enough, although I used more like 50. I don't know if there is a way 
to move the objects first before grabbing an updated event.target, or something 
similar.

The proof was more aimed at a helper that provides the outlines, borders, of 
the element being dragged, not visually cloning the entire element.

I'm confident there is a clean way to utilize event.target in the picking 
targets for dropping -process, since performance-wise it feels like the best 
way by far, especially with a larger number of droppables. Too bad the browsers 
dont provide an array of event targets so we could bubble and pick the one we 
want when the elements are on top of each other.

But I just had another idea, posting followup...

-- 
Suni
  ----- Original Message ----- 
  From: Paul Bakaus 
  To: jQuery Discussion. 
  Sent: Tuesday, November 28, 2006 6:12 PM
  Subject: Re: [jQuery] Interface Draggables/Droppables: New approach


  Juha, this is not a bad idea, but quite difficult if you have a difficult 
structured object.

  For example, my helper is a table with three columns all with a different 
background. Your way would be slicing the helper and having a one px space 
where my cursor is. Very interesting indeed, but also needs performance because 
of this: 

  1.) on drag start, you have to clone the object 4 times and wrap a div around 
every object.
  2.) then set the outer div to overflow: hidden and resize each of them like a 
puzzle around the cursor
  3.) Then move every 4 along with the cursor 

  I will test it, we'll see!


  2006/11/28, Juha Suni <[EMAIL PROTECTED]>:
    Considering option 3 and the disadvantage of the cursor not being able to 
be on top of the helper:

    Have you guys considered ways to go around this. Since #3 seems like the 
fastest, you might want to look for little tricks.

    I quickly crunched together a small proof-of-concept showing that you can 
get the effect of the cursor being on top of the helper while still accessing 
the elements below through event.target. Yes, technically there is no 
helper-element under the cursor, but a few surrounding it giving the same 
effect. Although at first it might seem a little hackish, the code isn't that 
much, and even my glue-and-gum proof-of-concept seems to work ok. At least it 
should scale nicely since it doesn't really care about the amount of droppables.

    It shouldn't be too hard to add some background color / image stuff to the 
"helper" if more visuals are needed.

    Oh, and this is 100% only Firefox-tested and coded, to see if this is 
feasible at all. Will propably explode with any other browser, currently.

    Check it out at: http://www.sparecom.fi/test/

    -- 
    Suni

    _______________________________________________
    jQuery mailing list
    [email protected]
    http://jquery.com/discuss/






  -- 
  Paul Bakaus
  Web Developer
  ------------------------
  Hildastr. 35
  79102 Freiburg 


------------------------------------------------------------------------------


  _______________________________________________
  jQuery mailing list
  [email protected]
  http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to