Jump to content
Search Community

visua

Plus
  • Posts

    4
  • Joined

  • Last visited

Posts posted by visua

  1. Thank you both for responding. That was quick and easy!

     

    Carl – your solution worked, though I had to wrap the params in braces

    dragScene[0].applyBounds({left: 0, width: $(window).width()});
    

    Diaco.AW – This worked flawlessly, thank you. I was over thinking it apparently  :mrgreen:

    • Like 1
  2. 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

×
×
  • Create New...