Search the Community

Showing results for tags 'set'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 / JS
    • GSAP
    • Banner Animation
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Categories

  • HTML5 / JS
    • Public
    • "Simply Green" Package
    • "Shockingly Green" Package
    • "Business Green" Package
  • Flash
    • AS3
    • AS2

Found 19 results

  1. set() on TimeLineMax

    Hi, I have a problem to understand the "set()" method. This is my html code (extract): <svg....> <path id="nube" opacity="0" ....</path> </svg> and this my js ("nube" is a reference to id="nube" in Angular 5): let tl = new TimelineMax({ delay: 3, repeat: -1 }) tl.set(nube, { opacity: 1 }) tl.to(nube, 9, { y: '-=30px',x: '+=17px', scale: 2 ,opacity: 0, ease: Linear.easeNone, repeat: -1 }, '') The problem is that the element "nube" is shown on start but I think that it should be hidden until 3s of delay. Why is showed on start? How can I do the element is shown when "tl" is started (with 3s delay)? Thanks in advance.
  2. set vs 0 in TimeLines

    Hi, I wondered why the only way I can trigger a quick reveal in Nested Timelines, is by using a duration longer than 0. As you can see in the CodePen example, the Blue, Green and Yellow circles should reveal themselves halfway through the Red circle's Timeline, but .set and a duration of 0 trigger initially, whereas the only way round it is to use 0.00001
  3. The example Codepen shows a text input whose label changes position depending on the input's `blur` and `focus` state. Given `TweenLite.set()` is used to initialise the position of my label element, what is the best way to get back to this position without repeating code? In my example, this is what I am currently doing; firstly, setting the coords of the label's initial position: const initCoords = { y: 62, x: 10 }; Then initialising the position using the coords: const initLabelPosition = () => TweenLite.set($label, { ...initCoords }); Then, when I need to toggle back I am again inserting the `initCoords` into a `TweenLite.to()`: const moveLabelInsideInput = () => TweenLite.to($label, animationDuration, { ...initCoords, fontSize: labelFontSizes.blur, ease }); I think I might be missing an easier way to do this. Is there a better way I can toggle back to the initial position created by `TweenLite.set()`?
  4. Hello, I think I've got the wrong understanding of how the set function works when placed inside a timeline. In the codepen I've created a small animation that should set the box to start at left=0px and then start an animation at the 1 second mark to move the box from 200 to 500px. The actual behavior is that the box already starts at 200px. I can also press the seek(0.0) button and nothing happens. As soon as the animation once passes the start time of the fromTo tween, the seek to 0s will work. Could someone please explain why? I need to set a start value for the animation that will always work in the way that each call to seek with values < 1s will place the box at position 0px. How can I accomplish that? Best regards Alexander
  5. Please can anybody help - I am new to GSAP and my jquery skills require improvement. I have worked out how to create random transforms on every path of an SVG image to create a dispersed vector polygon effect. I then want to animate these vectors back to their initial state when hovering a link so that the image forms and have achieved this. What I am struggling to do is that when the page initially loads, I want the dispersed vector image to display immediately i.e. not animate to the dispersed state and only begin to animate to / from the images original state when you hover on the link. Please check out my codepen - any help gratefully received...
  6. Use .set and keep existing css?

    If i have set transform either with css og TweenMax.set - e.g. transform: translateZ(100px); can I add other transform translates/rotations/etc. and keeping the translateZ?
  7. Hello there! I'm using TimelineMax to make a sequence for 3D objects using Three.js. So far so good, when working with numerical properties of objects. But I'd like to set true/false properties and use the state of the timeline. I know I can do my own functions (onComplete, onStart,...) but that requires me to keep control of the state while the timeline is playing, which is similar to create my own timeline function. The idea is to be able to scrub the playhead. So I used .set, both in TimelineMax or TweenMax to no luck. For instance: tm = new TimelineMax({align: start}); tm.add( new TweenMax(camera.position, 10, {x:100, y:100, z:100}), 1); //Works well tm.set(target, { visible: false }, 4); //Doesn't work tm.add( TweenMax.set(target, { visible: false, immediateRender: false, delay: 4}, 0); //Neither tm.add( TweenMax.set(target, { visible: false, immediateRender: false}, 4); //Neither Any ideas? Thanks
  8. Hi I am trying to change a text value in an animation using a timeline, for example, i'd like the text to animate off, the value to update, and then animate on again. I need to know that the animate on doesn't start until the text value has changed. I hoped to be able to use the timline.set(textfield, {text:"NewValue"}); but it seems that set/tween can only use numeric values? How can I best achieve this result?
  9. Using .set in a timeline

    Hi, For some reason, using .set within a timeline doesn't trigger. (see codepen) However, if I move the .set command to the start of the timeline, it does work: tl.set("#circle1", {autoAlpha:1}) .from("#circle1", 2.5, {scale:0.5, autoAlpha:0, ease:Power4.easeOut}) Any ideas why? Thanks
  10. .set() with xPercent doesn't work

    Using .set() with the percentage equivalent of x and y doesn't work http://codepen.io/marlonmarcello/pen/vGeZbj
  11. Resetting set

    Hey guys working on some responsive animation, not sure how to reset the stored values on media query change. Sure you know what I mean, if not just click the green box then decrease browser width. Thanks!
  12. Setting z-index before morph tween

    I've got an overlay that I have moved to the back of my page, so that it doesn't block my hover animation on the 2 circles. #open { visibility: hidden; z-index: 1; } When I open the overlay, I need it moved to the top, so that it will cover the circles, and also block their animation. My set doesn't seem to have any effect though. tl2.set('#open', {zIndex:5}) .to("#closed", 1, {morphSVG:{shape:"#open"}}) I've tried moving the set around the tl as well. It doesn't seem to work no matter where in the timeline I put it. I figure I probably want it at the beginning though, so that the morphSVG animation covers up the circles immediately.
  13. Hi! I'm working on a custom plugin that is project specific. Basically, I created a class that represents an SVG arc and the plugin will tween the rotation of the arc around a point and change its thickness etc. Everything works perfectly except when I try to pass in an array of targets, in which case only the first element in the array is tweened, despite init() being called and run successfully. I've spent all day trying to figure this out and I can't make any headway, and I was hoping someone here had seen something similar and could give me some insight. I copied the code over to a codepen to see what I'm talking about, but it is probably easier to just to clone the repo: https://github.com/tysmithnet/gsap-svg-arc-plugin Just load up index.html Key files: SvgArc.js - class abstracting the svg arc, pretty much just knows how to create an SVG path gsap-svg-arc-plugin.js - the gsap plugin index.html - test file illustrating the issue Thanks for looking! T
  14. two lines of code too many

    Sorry for not making a codepen, but my question is so pathetically simple I think it's unnecessary. The following works. (Obviously, it's just supposed to flash the two classes on and off in alternation.) But it doesn't work without the first (or last) two lines of code. Why not? I see redundancy here, and would like to refactor this properly. var foiled_crook = new TimelineMax({repeat:-1}); foiled_crook .set($('.crook'), {autoAlpha:"1"}) .set($('.crook-blocked'), {autoAlpha:"0"}) .add("foiled", "+=2") .set($('.crook'), {autoAlpha:"0"}, "foiled") .set($('.crook-blocked'), {autoAlpha:"1"}, "foiled") .add("trying", "+=2") .set($('.crook'), {autoAlpha:"1"}, "trying") .set($('.crook-blocked'), {autoAlpha:"0"}, "trying") ; Thanks, eh.
  15. Hello everyone This might be a stupid question but i had to ask to better understand the JS API .. I know that when you include TweenLite.min.js in your page that you use the TweenLite constructor when using different methods in the API But lets say If i have TweenMax.min.js INCLUDED in my page: what is the best usage for using set() .. using the TweenLite or the TweenMax Constructor?Its been said in the forums that you can use either TweenLite or TweenMax IF TweenMax.min.js is INCLUDED in your page... so I was curious as far as performance and/or preferred usage.. which is appropriate to use if I have TweenMax.min.js included in my page? or can i use both using TweenLite: TweenLite.set(element, {x:100, y:50, opacity:0}); or using TweenMax: TweenMax.set(element, {x:100, y:50, opacity:0}); or can i use either or ??? Im sure that what Im asking can relate to other methods in the API, when i have TweenMax.min.js included in my page.. so any help will be highly appreciated thanks in advance !
  16. what is faster.. using jQuery css() method or GSAP set() method. for example: // GSAP way TweenMax.set($image, {'opacity':1}); // or jQuery way $image.css('opacity',1); I was wondering which is faster or better to use? Should i only use set() for the properties that will be animated? Im used to setting css properties via jQuery css() method .. but wanted to know if the GSAP set() method is faster or more efficient? Any help will be highly appreciated?
  17. Get width after scale

    Hi, How can I get the actual width of an element after scaling it with Tweenmax? Example: $('#myDiv').width(100); // Sets width of #myDiv to 100; TweenMax.set($('#myDiv'), {scale:1.2}); console.log($('#myDiv').width()); // gives 100 instead of 120 How can I get the actual width of the div? Thanks a lot in advance, this thing is frustrating me and breaking my head today...
  18. tweenmax.set() callback

    Hello there again! I use TweenMax.set() to set properties like opacity and transform(x,y,rotate,scale(x,y)) for IE6-8, and it works like charm, everything is perfect! But I have one issues, which I don't know how to solve. The life cycle of my page: Set DOM values via MVC engine Wait until $(window).load() and then fadeIn() page Problem is TweenMax.set() executes on slow computers after load is complete and then user needs to wait like 2-3 seconds until element by element is positioned for him. Basically it look like mess. What I would want is to know when TweenMax actually sets the values and after that I show content to the user. Is it possible, has anyone ever had this problem? Sincerely, Masq
  19. Hi, I'm trying to tween a Raphael set: var atomH1_1 = paper.set(); var atom_Circle1 = paper.circle(10, 10, 25).attr({id: 'circle1','gradient':'70-#00CC00-#00FF00','stroke-width': '0'}).data('id', 'circle1'); var atom_Circle2 = paper.circle(20, 20, 25).attr({id: 'circle2','gradient':'70-#0000CC-#0000FF','stroke-width': '0'}).data('id', 'circle2'); atomH1_1.push(atom_Circle1); atomH1_1.push(atom_Circle2); tween1 = TweenMax.to(atomH1_1, 0.3, {raphael:{'tx':100,'ty':100,'scaleX':0.5,'scaleY':0.5},ease:Power1.easeInOut, onComplete:nextStep}); But it seems it triggers an error in GreenSock (): TypeError: c is undefined file:///E:/the%20Factory/Vialight/06_www/js/greensock/plugins/RaphaelPlugin.min.js Line 13 When I use the Raphael animate, it works fine, (but that's not what I'm looking for): atomH1_1.animate({transform: "t100,100"}, 1000); Is it not possible to tween Raphael sets? Or what am I doing wrong? EDIT : I sort of solved the problem by using multiple targets in GreenSock: var mySet = [atom_Circle1,atom_Char1]; TweenMax.to(mySet, 2, {raphael:{'tx':100,'ty':100},ease:Power1.easeInOut});