Jump to content
Search Community

Search the Community

Showing results for tags 'draggable'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

  1. Hey All, I'm pretty new to these tools, only been working with them for about a week and I'm VERY impressed -- Great work! I'm using the tools to assist me in building a mobile app and they are performing delightfully with phonegap on both iOS and Android devices. Kudos. I am wondering if there's an easy (or at least highly performant) way in which to cause a "Draggable" item (in my situation, basically a div/box on the screen) to change it's opacity/alpha based upon how far away it gets from the "bounds" it's located within? Basically, I want the user to be aware that moving the box a certain amount will dismiss it and remove it by fading the box out more and more as it moves away (and I'd want to fade it back in if it returns), but I haven't found a great way to do this yet. Any help/thoughts would be greatly appreciated -- Thank you! -Flinn
  2. Hi, I would like to report a bug found using Draggable (great library!), hope this is the right place. If you drag an element (x,y) inside a parent that has been previously rotated, then this.x and this.y values inside the onDrag callback refer to horizontal and vertical directions, ignoring the fact that the parent is rotated. The result is that if, for example, you rotate the parent by 90deg, when you drag the child horizontally it moves vertically and viceversa. The fix however seems easy. Let's say we have the angle of the parent rotation expressed in degree in the variable 'angle'. Then inside the callback onDrag: angle = - angle * Math.PI / 180; var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); var relativeX = (this.x * cosAngle) - (this.y * sinAngle); var relativeY = (this.x * sinAngle) + (this.y * cosAngle); relativeX and relativeY are now the corrected values relative to the parent of the Draggable element. Hope this could be useful. Thanks for your great libraries.
  3. I am attempting to resize a draggable DOM. As in the user can select an edge of the DOM and drag it to a new size. Is this something that GSAP is designed to handle or am I on the wrong track? jQueryUI 'resizable' doesn't really work with a draggable (or I haven't yet been able to get it to work).
  4. Hi guys, I was running a little test site in v11 and it was working fine except Draggable wasn't supporting IE11 touch events. No worries, I knew that. So then v12 came out, and I grabbed it and overwrote my .js files - but there's no ThrowPropsPlugin in the v12 package. I tried using the old one from v11 and got some unexpected behaviour - Draggable only fires on every second click or touch.
  5. Draggable works everywhere except IE11 (edge mode), in which it only works on the second click... Has anyone else experienced this? I thought it might be my code but the same problem occurs on the demo here: http://www.greensock.com/draggable/ Thanks
  6. hi, i'm having a problem when using draggable and then scaling objects with css transforms: everything works fine so far, but the scaled div gets blurry after scaling. first i thought it's a browser problem, but when leaving draggable away, the rendering works as expected and the div's text looks sharp again, no matter what scaling factor is used. when using draggable, it seems to me, that the browser treats the scaled object as an image... maybe there's the possibility to force the browser to re-render? would be nice if there's any workaround ;-p thanks! michael
  7. I have create a div like this: <div id="content" > <div id="textContent"> aaaaaaaaaaaaaa </div> </div> Draggable.create("#content", { type:"top,left", edgeResistance:0.5, bounds:window }); But I cant copy the words "aaaaaaaaaaaaaa". I have tried data-clickable="true". But I still cant set focus on the words. Plz help me . . BTW I have a simple solution.But cant use throwProps. <div id="textArea"> aaaaaaaa </div> <div id="content"> </div> Draggable.create("#content", { type:"top,left", edgeResistance:0.5, bounds:window, dragClickables:false, onDrag:function() { $( "#textArea").css({"top":this.y,"left":this.x}); } }); And sorry about my terrible English...
  8. Hi there, First of all I like to say i love your product and have been actively using the AS version along time and when a js version came out, it was like a god set. I have a issue with the Draggable class, basically i am using the class to drag a custom slider. When I then proceed to another section of my web application and then come back to the page which has the slider class there is no way to reset the slider drag handle position back to 0, I have tried making the instances of the draggbable item to null and have even clear the style attr, but for some reason when I recreate new Drag instances the transform matrix data is of the old data this is how I try to get rid of the old instances: for (var i = 0; i < this._draggables.length; i++) { this._draggables.disable(); //disable the instance. this._draggables=null; } $(".drag_handle").attr("style","") this._draggables=null; and this is how I create it this._draggables =Draggable.create("#allocate_people .drag_handle",{type:"x",bounds:$('#allocate_people .drag_handle').parent()}) any suggestion as to what I can do to reset it back to it original position thanks, Steve
  9. Hi everyone, its been a few days since I found out and started using gsap js and must admit its an awesome framework. I make native games for iOS and now I evaluate gsap for html 5 cross platform 2d game development. I have a strange performance issue regarding the Draggable utility on iOS devices (maybe on other platforms too but I have not tested any other device). When the user moves the draggable element around with his finger I observe high CPU usage (55-65% on an iPhone 3GS) while when the user is not interracting with the element the CPU usage is 25-35%. I downloaded an updated version of Draggable from here but there was no difference. I am at your disposal for further info and testing!
  10. Hi, I am new to GreenSock and trying to use Draggable plug in of GreenSock. I have added the JS libraries in following order <script src="../../../js/jquery-1.10.1.min.js"></script> <script src="../../../js/jquery-ui.min.js"></script> <script src="../../../js/greensock/plugins/ThrowPropsPlugin.min.js"></script> <script src="../../../js/greensock/TweenMax.min.js"></script> <script src="../../../js/greensock/plugins/Draggable.min.js"></script> My HTML code structure is as follows: <div id="imageContainer"> <div class="galleryImg"></div> </div> I completely flush #imageContainer and add few elements, with class name galleryImg, to it dynamically. To make the imageContainer draggable I added following code in my JS Draggable.create("#imageContainer"); However, when I try to drag the element, an error is thrown and the element is not draggable. The error from FireBug is as follows: TypeError: i._gsTransform is undefined ...},this.content=o,this.element=t,this.enable()},H=function(i,n){t.call(this,i),i The error also occurs as soon as I click (mouseDownEvent) the imageContainer. Is there anything am I doing wrong over here ? Which JS files do I need to add to use Draggable? Where can I find standalone sample examples on how to use GreenSock plugins? (e.g. JQuery has this "View Source" link which can display full HTML to understand the whole example) Please guide.
  11. Sorry if this has come up before. I did have a search, but wasn't sure how best to describe it. Anyway, I have a long HTML page which scrolls vertically. Nothing unusual about that... On this page, I have banners which are horizontally draggable, using Draggable. However, when I scroll vertically on iOS, if I drag within the Draggable banners, it stops the page scrolling. I want the Draggable banners to scroll horizontally, and the page to scroll vertically. How might I work around this? Is it even possible with iOS? Loving your work as always! Cheers, Steve
  12. Hey guys, I find myself in a pretty interesting UI challenge that I think Draggable might be able to solve. I will try to explain it as clearly as possible. Here's what I want to do – on both mobile and desktop: 1. Have a list of edge-to-edge elements (Think the contacts list on iOS without the separators) that the user can scroll through normally. 2. Allow the user to tap / click and select/deselect the list items 3. Hold the finger or mouse button down for 800ms and initiate drag/drop so that the items can be re-ordered. The main problem is having drag and native scroll at the same time on mobile devices. Quite naturally because Draggable uses the touch events to perform its dragging magic, so when you try to scroll the list, you instead throw the list items around. I plan on tackling this one by setting up my own mousedown / touchstart listener and combine it with a timer that would then create a new Draggable instance if the mouse/finger is still pressed after the 800ms. At that point I could forward the mouse position via an event to the new draggable.startDrag() method and have it drag instantly after being created. From what I can tell, this would be the simplest way to solve my problem, but I just wanted to make sure this logic isn't part of Draggable as is, and that the problem hasn't already been solved for me.
  13. I'm playing with Draggable and trying to use scrollTop as the type but it's not working. If I remove the type it works fine (or set it to any other type except scrollLeft). Any ideas? http://jsfiddle.net/Krcd6/4/
  14. Hi, I'm not exactly a coder but would like to use greensock for interactive comic book animation. There was already one question here about comics, but that was about controling the timeline in scrolling. I would like to use divs for slides/pages and you should swipe horizontaly from one to the next. I would like to control the animation within each div when that div/slide/page is visible and stop the animation when you swipe to other page. There should be restart of animation every time you revisit the page. Can I use draggable for swipe animation between slides? Would love to see some easy example of this... Thanks!
  15. Hey guys! I'm trying to make my Kinetic Layer draggable with the draggable plugin but I'm not quite sure if I'm doing it right. Maybe you guys can help me out a little. This is what I have so far: viewPort = new Kinetic.Stage({ container: 'container', width: window.innerWidth, height: window.innerHeight }); mapLayer = new Kinetic.Layer(); Draggable.create(mapLayer, {type:"x,y", edgeResistance:0.65, throwProps:true}); mapLayer.add(...); // adding map tiles to the layer viewPort.add(mapLayer); but I'm always getting: "Uncaught TypeError: Cannot set property 'onselectstart' of null --- Draggable.min.js:14". I have a feeling that I'm doing something terribly wrong here ... greetings Skripted
  16. Hi, Apparently select elements are ignored in a Draggable object, they are not triggered at all. In the 0.9.0 version of Draggable.js, input fields are now working properly ; so I just added "select" to the _clickableTagExp property (the "check list" allowing a tags, input, button, etc. to be triggered). However it does not seem to be enough. The select element is being triggered, but the dragging sort of sticks to the mouse. Any idea on how to solve this? (Or are you already on it...)
  17. I've been working on an AV timeline scrubber. For the most part, it's working, except after a target element is dragged, then the animation stops and will not resume. It does call the seek appropriately with the correct value in seconds. If I kill the animation and restart it each time after a drag event, the coordinates of the scrubber knob get messed up and I cannot tell where the darn thing is at or where it should be. Plus it seems to make more sense that an animation not have to be recreated every time. What am I missing here? D var knob_offset = 4; Draggable.create("#pb-scrubber-knob", { bounds: $("#pb-scrubber-bounds"), type: "x", edgeResistance: 1, onDragStart: function() { var knob = Draggable.get("#pb-scrubber-knob"); knob.update(); }, onDrag: function() { $("#pb-scrubber-fill").width( $("#pb-scrubber-knob").position().left + knob_offset ); $("#pb-elapsed-time").text( window.odeshell.formatTrackTime( window.odeshell.getTrackPosition())); }, onDragEnd: function() { $("#pb-elapsed-time").text( window.odeshell.formatTrackTime( window.odeshell.getTrackPosition()) ); window.odeshell.seekScrub(); }, onUpdate: function() { $("#pb-scrubber-fill").width( $("#pb-scrubber-knob").position().left + knob_offset ); }, }); window.odeshell.startScrub = function() { var dur = window.odeshell.getScreenDuration(); var animate_to = $("#pb-scrubber-bounds").width()-knob_offset; $("#pb-elapsed-time").text(window.odeshell.formatTrackTime(0)); if ( window.odeshell.tlScrubberKnob !== undefined ) { window.odeshell.restartScrub(); } else { window.odeshell.tlScrubberKnob = new TweenLite( "#pb-scrubber-knob", (dur/1000), { left:animate_to, immediateRender: true, ease:Linear.easeNone, onUpdate: function() { var sndpos = window.odeshell.getTrackPosition(); var dur = window.odeshell.getScreenDuration(); var kpos = $("#pb-scrubber-knob").position().left; var bounds = $('#pb-scrubber-bounds').width()- ($("#pb-scrubber-knob").width() + 8); $("#pb-elapsed-time").text( window.odeshell.formatTrackTime(sndpos)); $("#pb-scrubber-fill").width(kpos); if ( window.odeshell.playComplete() && (kpos >= bounds) ) { window.odeshell.stopScrub(); } } }); } }; window.odeshell.restartScrub = function() { if ( window.odeshell.tlScrubberKnob !== undefined ) { window.odeshell.tlScrubberKnob.restart(false, false); } }; window.odeshell.seekScrub = function() { if ( window.odeshell.tlScrubberKnob === undefined ) { return; } var kpos = $('#pb-scrubber-knob').position().left; var dur = window.odeshell.getScreenDuration(); var animate_to = $("#pb-scrubber-bounds").width()-knob_offset; var prct = kpos/animate_to; var sndpos = dur * prct; if ( sndpos < 0) { sndpos = 0; } if ( sndpos >= dur) { sndpos = dur; } var seekpos = Math.round(sndpos/1000); $("#pb-elapsed-time").text(window.odeshell.formatTrackTime(sndpos)); window.odeshell.setTrackPosition(sndpos); window.odeshell.tlScrubberKnob.seek(seekpos); if ( !window.odeshell.tlScrubberKnob.paused() ) { window.odeshell.tlScrubberKnob.play(seekpos); } }; window.odeshell.resumeScrub = function() { if ( window.odeshell.tlScrubberKnob !== undefined ) { window.odeshell.tlScrubberKnob.resume(); } }; window.odeshell.pauseScrub = function() { if ( window.odeshell.tlScrubberKnob !== undefined ) { window.odeshell.tlScrubberKnob.pause(); } }; window.odeshell.stopScrub = function() { if ( window.odeshell.tlScrubberKnob !== undefined ) { window.odeshell.tlScrubberKnob.pause(); } };
  18. Hello! Has anyone noticed when using Draggable with throwProps:true, with restricted bounds AND with snap that if throwing the object and try to catch it before it reaches its destination it directly jumps to calculating end position. It should just freeze the object when the user click on it when it still in motion. Like when you are not using the snap. Im creating a webapp with a navigation that I can throw Like the facebook app. Try with the examples http://www.greensock.com/draggable/ the first one "Throw" with the setting "Snap to grid" checked. You will see what happens. Any thoughts or solution? Thanks //Robert
  19. Ratchet

    Nested draggables

    Hi there, I consider using Draggable in my mobile game (either with or without throwprops), in a similar fashion to games like WordFeud: a draggable stage with draggable tiles on it. For this it seems most logical to have draggable objects inside a div that is itself draggable. This seems to work somewhat, though when I drag the tile, the draggable stage also moves (hence the tile itself moves twice the dragged distance). it seems easiest to cancel propagation of the event using the onDragStart callback, however it seems that no event object is passed into this callback so I cannot call e.stopPropagation(). Who has an elegant solution for nested draggables? By the way, I also tried temporarily .disable() on the top draggable but that gave serious javascript/dom errors. Here is my code so far. HTML: <div id="scrollContainer"> <div id="scroller" style="overflow: visible; padding: 0px; position: relative; height: 300px; width: 300px;"> <div id="tile0"> <img src="img/tile_0.png" style="position: absolute;top:0"> </div> </div> </div> And js: Draggable.create("#scroller", {type:"scroll", edgeResistance:0.5, throwProps:true}); Draggable.create("#tile0", {type:"x,y", edgeResistance:0.65, onDragStart: function(event){ //event not available here? }});
  20. The next update to Draggable introduces some useful new properties: pointerX pointerY endX endY The "pointer" properties refer to the mouse (or touch) location from the last event (like event.pageX) associated with that Draggable instance. The "end" properties refer to where the element will land. Those get populated as soon as the user releases the mouse (or touch). Draggable also has the following properties (which aren't new): x y xMax xMin yMax yMin Here's the dilemma: technically there's an inconsistency with the way the new names are structured compared to the existing properties - "x" and "y" are at the end instead of the beginning ("endX" vs. "xMax"). Matching the current naming structure seems awkward ("xPointer" and "yPointer" don't seem nearly as intuitive as "pointerX" and "pointerY"). I don't like having inconsistencies, though. Should we change the max/min names so that the "x" and "y" are at the end? The only awkward one is "maxX" because there are two x's at the end. So it'd mean changing them to "maxX", "minX", "maxY", and "minY". Or we could leave the old/existing properties the same and live with the inconsistency. The nice thing about this is it wouldn't break any existing code that users have written. However, since Draggable is so new, this isn't as big of an issue - if we're going to make a change to the API, it's much better to do it now before more people start using it. What are your thoughts? We need to make this decision quickly, as the goal is to release the Draggable update by tomorrow. Your input is greatly appreciated. (by the way, the upcoming new features are mentioned in this thread: http://forums.greensock.com/topic/8056-draggable-invert-bounds-behavior/#entry31763)
  21. SteveZ

    Infinite Draggable

    Is it possible to create an infinite draggable loop using GSAP Draggable coupled with TweenMax? I'm creating an animation demonstrating a briefcase combination lock - the kind with three or four inline tumblers next to each latch on a briefcase that are rotated to form a combination. Only one number (an image-not text) appears on the face of the tumbler I made. Draggable works great when I move ("rotate") the tumblers to reveal the next successive number; but my image is a png file that is a vertical line of numbers from 0 thru 9. I would like the numbers to repeat or loop if I was to continue dragging the tumbler giving the impression that it loops around.
  22. Hello I like Draggable a lot! Question: is it possible / will it be possible to drag an object along an svg-path or canvas-path or within an non rectangular svg-shape / canvas-shape
  23. Hello i'm working with Draggable and the ThrowPropsPlugin - they are fantastic! However I have a problem. How can I get the final x, y position of the dragged object? When dragEnd is outside the boundery, ThrowProps will move the object back inside the boundery (very nice!) but where does it stopp? I'm working on a kind of mouse-follower, where one object follows the draggable one.
  24. I am using draggable on a div containing svg elements If I dont use draggable and scale the div via:- var i = $('#chart'); TweenLite.to(i, 2, {scale:4}); The edges of the SVG text and circle etc remain crisp as you would expect from scaled vectors. However if I enable draggable via:- var aD = Draggable.create("#chart", {type:"x,y", edgeResistance:0.5, throwProps:true, bounds:window}); and then zoom the SVG element become fuzzy as though they were scaled pixels. This happens even if I disable draggable before scaling Any ideas why this might be? Thanks - Dean Update: Scale without Draggable uses -webkit-transform: matrix(... Scale with Draggable uses -webkit-transform: matrix3d(... using Safari and Chrome on Mac - not a problem on Firefox (not using webkit) Ah: Putting force3D:false as in: TweenLite.to(i, 2, {scaleX:4, scaleY:4, scaleZ:1, force3D:false}); Is their a reason for the problem with matrix3d and scale on webkit? solves the problem
  25. hi, first of all, thanks for the new draggable stuff, really awesome! i think, there's a strange behaviour when using the draggable plugin on mobile devices: i build a draggable div with hyperlinks inside. dragging works as expected while the links inside the draggable div don't work anymore. on desktop browser everything works fine. seems if there is a problem with the touch events in the draggable.js. here's the demo... http://dev.tm74.de/dragtest/ any idea? thx michael
×
×
  • Create New...