Jump to content

Search the Community

Showing results for tags 'hit test'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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

Product Groups

  • Club GreenSock
  • TransformManager

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 2 results

  1. Hi Folks, I think I'm missing something super simple, but I can't find it. In the vanilla demo hit test example an element from a "droppables" collection is used as a jQuery selector, and a "highlight" class is added tot hat element while the hit state is true and removed when it is false. The effect is that the element *underneath* the dragged element is highlighted. I want to invert that effect, and have the item that is being *dragged* highlighted if it is dragged over a droppable element. I expected to be able to do this fairly easily by changing the $(droppables[i]).addClass("highlight"); for $(this.target).addClass("highlight"); however this doesn't work. I've included a fork of the GSAP hit test demo as a codepen, and I've also added a couple of console log statements that show that the element being dragged is being assigned the additional "highight" class, but the visual effect isn't seen. Many thanks Shaun
  2. This chunk of code was working great in one JS file, but now I'm using the code in another project and it's giving me this error in Chrome: Draggable.js:2186 Uncaught TypeError: _unwrapElement(...).getBoundingClientRect is not a function The line in my code that's triggering the error is the line below, "if (this.hitTest..." function onDrag() { G.hitting = null; tile.positioned = false; for (var i = 0; i < G.tiles.length; i++) { if (this.hitTest(G.tiles[i], G.dragThreshhold)) { G.hitting = i; } } console.log("currently hitting "+G.hitting); } How do I go about troubleshooting this? I'm sure the error isn't actually in Draggable.js, but instead it has something to do with how my code is set up. FWIW, the code chunk in the broken page is identical to the code in the working page. I've tried changing the order the JS scrips that are being loaded on the page, but no luck. What are some other things I can try to troubleshoot this?