Dave, I've read the code for this class extensively. In fact, I am in the process of rewriting it to improve speed, memory cleanup, standards compliance, event hooks, compactness, Prototypishness, etc.. It is a pretty hefty library, especially once you add the CSS, but it does look very nice indeed.  Looking at Sebastian's example I assumed he was looking for a lightweight solution. PWC uses a table layout for each window, which didn't play nicely when I tried to put a calendar inside it... I have to say it's not my favorite Prototype-based code.. I trolled the message board for a while and there seems to be a lot of people using it...and a lot of people having problems with it...

Looking at Prototype's Position methods I think my proposed solution of using edge-detection on a single div is feasible. It would be much nicer than the table-layout IMO. Of course there is always some crazy browser specific bug that'll make things more difficult than they should be.. Take for instance IE6/7s refusal to maintain the margins set on a position: relative div when said neighboring parent elements (table rows) would resize due to Ajax content insertion.. Man that was frustrating..

Colin

Dave Crane wrote:
Sebastian, Colin,

There's a floating window class built on top of Prototype here

http://prototype-window.xilinus.com/samples.html

That can be resized by drag and drop. I've only looked at this as a gormless 
end user and thought "wow, that's really neat", so I can't comment on how 
they've done it, but you might like to point Firebug at it and get a few 
tips.

HTH

Dave 

On Wednesday 14 February 2007 19:05, Colin Mollenhour wrote:
  
It seems the simplest (nay, most oft used, perhaps it isn't the
simplest) solution is to create the border out of separate elements
altogether and observe those for mousedown, but I suppose you could do
some boundary checking on mousedown for the entire element and if the
mouse is a certain distance from the edges you could then create a
mousemove event which would track the mouse and do the resizing. You'd
have to figure out which edge was clicked, and then make sure you do the
resizing in the correct direction (i.e. the opposing edges wouldn't
move).  Also, one disadvantage to this single-element method would be
that you couldn't simply set the CSS cursor property for the draggable
edges to cue the user that it is resizable, but you could observe
mousemove on the mouseover and change it dynamically... Sounds slow..
So if you are looking for a solution that is as simple as making the
element draggable was, the short answer is I don't think there is one
currently, but I'd love to see a class that adds this functionality in
the same style Draggable does, perhaps using the border-width property
to automatically set the bounds checking variables.. Anyone know why
this wouldn't work?

Colin

Sebastian Kurt wrote:
    
Hi,
 yesterday i build up some boxes(DIVs) an meke them draggable. It was
so easy an fast implemented, great choice to use script.aculo.us!
but now i tried to figure out if it ist poosible to resize a draggable
div with the mouse by clicking on the border an dragging with
keypressed to the new size. is it possible to do so on a not draggable-
element?

http://hoodrich.skurt.de/

thx, sebastian
      
--
This email has been verified as Virus free
Virus Protection and more available at http://www.plus.net
    

  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to