Jump to content

# Search the Community

Showing results for tags 'perspective-compass'.

• ### Search By Tags

Type tags separated by commas.

### Forums

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

### Product Groups

• Club GreenSock
• TransformManager
• Supercharge

### Categories

• Learning Center
• Blog

• Products
• Plugins

• Examples
• Showcase

• FAQ

### Categories

• ScrollTrigger Demos

### Categories

There are no results to display.

• 0 Comments

• 0 Replies

• 0 Reviews

• 0 Views

Found 1 result

1. ## Rotating to specific point

Hi guys, For a first post I want to thank Jack and co for producing a great product. The api and methods are very straight forward and quite elegant. Now onto the question: Is there a way to rotate an element to a specific/global angle? So far all of my tests have (seemingly) rotated the element in question to an arc relative to its current position. Assume our scale is degrees, and "up" is 0 with increments added from clockwise rotation (to 360 obviously): var rotateMe[0] = document.getElementById( "div1" ); var rotateMe[1] = document.getElementById( "div2" ); var rotateMe[2] = document.getElementById( "div3" ); or more easily: var \$rotateMe = \$( "div.rotateMe" ); The initial script: for( i = 0; i < \$rotateMe.length; i++) { TweenLite.to(\$rotateMe[i], 1, {rotation: ( 45 * i ), transformOrigin:"left 50%"}); } This produces a nice "fan" effect of elements, all with a different offset angle. If I now want to rotate ALL elements to a specified position (lets say 270* using the above "compass") how would I go about this? One solution is to create an equation within another loop that references the elements index number and calculates appropriately, but this seems overly verbose. I've had a search for a previous question like this but I couldn't find anything close (although my terms may be off). If this helps all elements are absolutely positioned so they stack appropriately on top of each other (or I can pass a z-index attribute if needed). Thanks
×