Created
September 1, 2011 17:52
-
-
Save juandopazo/1186777 to your computer and use it in GitHub Desktop.
Constrain resize and drag plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI().use('overlay', 'resize-plugin', 'resize-constrain', | |
'dd-plugin', 'dd-constrain', function (Y) { | |
var overlay = new Y.Overlay({ | |
width: 80, | |
height: 80, | |
x: 30, | |
y: 30 | |
}); | |
overlay.plug([Y.Plugin.Resize, Y.Plugin.Drag]); | |
overlay.dd.plug(Y.Plugin.DDConstrained, { | |
constrain: '#test' | |
}); | |
overlay.resize.plug(Y.Plugin.ResizeConstrained, { | |
constrain: '#test', | |
minWidth: 50, | |
minHeight: 50 | |
}); | |
overlay.render('#test'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment