| Page 1 of 1 | [ 3 posts ] |
|
Hi all,
suppose I have the following html content : Code: <div id="parent" style="position:relative;border:1px solid"> <div id="child" style = "position:absolute;width:800px;height:600px;"> </div> now i create a resize widget : new Y.Resize({ node : '#child' }).plug(Y.Plugin.ResizeConstrained, { constrain : '#parent' }); then i create a drag for the child element so that it is draggable within the parent : new Y.DD.Drag({ node :'#child' }).plug(Y.Plugin.DDConstrained, { constrain2node : '#parent' }); I open the page in the browser (either firefox, chrome,ie) , drag the child to the top left corner of the parent, then drag the bottom handle of resize downwards, the resize with also shrink the width of the element from right to left as i drag the bottom handle down. If I remove the border of the parent, it works fine. I think it is because with child having absolute position and parent having a border, when in the top left corner of the parent, the left/top positon of child will be negative, but the child is supposed to be constrained in the parent(set by the Resize). Is it a bug or am I using the widgets incorrectly? Thanks. |
|
If you want to constrain something properly, you need to make sure that the "parent" element doesn't have any styles that will interfere with the constrain or things will be bad. Add a div between "parent" and "child" and use that as your constrain parent.
|
|
Hi Dav, thanks for the reply. yeah problem solved after adding a div between parent and children. cheeers
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group