I have a wide element in my project that I've applied the Draggable behavior to. My aim is to make it so that you can only drag the element to its absolute left, and right. This works rather well so far, however I've been unable to make the bounds adjust properly when the browser is resized. This noticeable if you have a small viewport, then scale it larger and drag the element to the left, its right boundary is still at the old viewport size. http://www.michaelnovia.net/challenge/006/
Here's my code
Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
dragScene = Draggable.create(sym.$("scene"), {
type: 'x',
throwProps:true,
bounds: {left: 0, width: $(window).width()}
});
});
Symbol.bindElementAction(compId, symbolName, "window", "resize", function(sym, e) {
// insert code for resize event here
dragScene[0].applyBounds();
});
Thanks,
Michael