| Page 1 of 1 | [ 4 posts ] |
|
I am having problem changing size of an element that has a wrapping Resize via setStyle call. If I try to change width of the element and then try to resize it, the width goes back to the original width before setStyle call, so set style did not propagate to the wrapping resize.
What is the correct way to resize the resize? (I already have tried reset and it did not work) The test is below. Click Resize to set width and then click on the top resize handle. The width gets reset back to the original width. The only way to workaround I found is to destroy() resize and recreate it. Thanks <script type="text/javascript" src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script> <input id="resize" type="button" value="Resize" onclick="resizeTest(); return false;" /> <div style="background:#CCC;width:200px;height:200px;position:relative;" id="demo"></div> <script type="text/javascript"> var Y, resize; function resizeTest() { Y.one('#demo').setStyle('width', '300px'); } YUI().use('resize', function (YUI3) { Y = YUI3; resize = new Y.Resize({ node: '#demo', preserveRatio: true, wrap: true, handles: 't' }); }); </script> |
|
Destroying and recreating the resize is the proper thing to do if you want to change the size after the fact.
|
|
Hmm, does not seem to be very user friendly, I am afraid. Can't you at least introduce properties in Resize to set size manually?
Thanks for the reply. |
|
File a ticket, it's a Utility so its acceptable to destroy it and recreate it..
|
| Page 1 of 1 | [ 4 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