Jump to content
Search Community

Rodrigo last won the day on April 28

Rodrigo had the most liked content!

Rodrigo

Administrators
  • Posts

    6,653
  • Joined

  • Last visited

  • Days Won

    287

Everything posted by Rodrigo

  1. Hi, I haven't been able to reproduce the subject of this post, please check that you're using an updated version of the engine (current version is 1.9.3, cdn links are updated too). Anyway I've created a simple example that sets the z-index property of an element, then tweens top, left and z-index property of the element and the z-index doesn't change beyond the tween var. Something like this: CSS #div1{ position:relative; width:150px; height:150px; background:#00f; margin-top:10px; } JS $(document).ready(function(){ var div1 = $("div#div1"), log1 = $("div#log1"), log2 = $("div#log2"), log3 = $("div#log3"), btn1 = $("button#btn1"), tn1 = new TweenMax.to(div1, 2, {top:200, left:300, rotation:360, zIndex:20, paused:true, onStart:tn1Start, onUpdate:tn1Update, onComplete:tn1Complete}); TweenMax.set(div1, {zIndex:50}) function tn1Start() { log1.children().html(div1.css('z-index')); } function tn1Update() { log2.children().html(div1.css('z-index')); } function tn1Complete() { log3.children().html(div1.css('z-index')); } btn1.click(function() { log1.children().html(''); log2.children().html(''); log3.children().html(''); tn1.play(0); }); }); If you remove the set tween, add the z-index value in the inline style and remove the zIndex in the tween, the element's z-index doesn't change neither: CSS #div1{ position:relative; width:150px; height:150px; background:#00f; margin-top:10px; z-index:50; } tn1 = new TweenMax.to(div1, 2, {top:200, left:300, rotation:360,/* zIndex:20,*/ paused:true, onStart:tn1Start, onUpdate:tn1Update, onComplete:tn1Complete}); //TweenMax.set(div1, {zIndex:50}) Even if you change the position to absolute there's no difference. You can see it working here, and you can make the changes in there to see the behavior: http://codepen.io/rhernando/pen/whDdj Also it would be great if you could set up a working example of your problem in order to check what could be causing the problem. Hope this helps, Cheers, Rodrigo.
  2. Hi, No problemo, glad that it worked. Now regarding the tween keep going even when the timeline is paused, that's an odd behavior, if you check the fiddle you'll see that the background color change from blue to red stop at a purple shade meaning that the timeline is paused stopping all the tweens nested inside it, and if you comment the timeline.pause() line and put inside a console log you'll see the element color changing to red after 10 seconds and the console log triggering at 2.5 seconds, once the short tween has completed, something like this: mc2.updateTo({css:{ width: "50%"}, onComplete: function() { /*timeline.pause();*/ console.log("foo bar"); } }, false); You can see it here: http://jsfiddle.net/rhernando/Zx4Vr/3/ Can you provide a simple example of your code?, in order to see what could be the problem. Cheers, Rodrigo.
  3. Hi, Your site is looking good, keep up the good work. A suggestion will be to keep using backgrounds, the New York background you're using is quite nice, maybe you could create a separated tween for the background and the content, so they can get into position at different speeds. Regarding some of the sites you posted the batman one has a js file: http://www.thedarkknightrises.com/dvd/js/site.js but you're talking over 4000 lines of code so you'll need some patience. You could look at this site for more ideas, hey've done a pretty good job too: http://www.theartofraw.g-star.com/ Here is the main js it's "only" 1300 lines so it's a little more simpler than the batman one http://theartofraw.g-star.com/js/main.js In order to access the js files from a site you need to use developer tools (for webkit based browsers) or firebug (for firefox), those are very useful tools when it comes to see the structure of a site or app. Now in terms of that I wouldn't recommend you to spend a lot of time reading other developers code, but to check the pages and see what is happening and think how could that be done with GSAP, it could take more time but you'll learn quite more in that way. Also there are quite a few forums and sites with tutorials to learn how to do a specific task, then you put them all together (here is where the timeline is your best friend and ally) and voila!! you got your site. As far as structuring a site with GSAP I'm more of the idea of using GSAP to present your site to the visitor and let them use the site in a fun way but always keeping in mind why that person landed on the site, so it's not all about the animations, it's also about the content, a good balance between both is the winning formula, and the beauty of GSAP is that the possibilities are almost infinite in order to create a amazing way to present the content. It's really a one step at a time type of thing so my best advice would be to be patience and just create single samples (there are tons of those in the forum) and then you'll be able to enhance their complexity, and keep in mind that there's always someone here in the forums willing to help you. Cheers, Rodrigo.
  4. Hi, No problemo. I've updated the fiddle to work based on the position of a theoretical scroll bar at the bottom of the page. If you click so the bar goes to the left the timeline will loop forward, if you click so the bar goes right the timeline will loop backwards: http://jsfiddle.net/rhernando/PZB4y/2/ Now keep in mind that this is not based on any type of user interface event like clicks, keys, mouse or scroll pad, just the position of that element, so in your case you should look for an element that changes some css property value and associate that change to the direction of the timeline. Also would be helpful to see some reduced sample of what you're trying to do. Hope this helps, Cheers, Rodrigo.
  5. Hi Spiv, The best way could be to check the variations of the window scrollLeft position (JQuery API) and using conditional logic you can set your tween forward or backwards, something like this: $(document).ready(function(){ var div1 = $("div#div1"), tl1 = new TimelineMax({paused:true, repeat:-1, onReverseComplete:reverseLoop}), isForward = false, isBackward = false, previousPos = $(window).scrollLeft();//original position of the scroll bar, 0 when the page loads tl1 .to(div1, 2, {left:300, top:300}) .to(div1, 2, {rotationZ:360}); function reverseLoop() { //you get the total time of the timeline to set the correct point //for the reverse method, like this you can change your timeline //dynamically. If some tween has a repeat or repeat delay you should //use total duration var tl1Time = tl1.duration(); tl1.reverse(tl1Time); } $(window).scroll(function() { newPos = $(this).scrollLeft();//we get the current position deltaPos = newPos - previousPos;//how the position has varied previousPos = newPos; if(deltaPos > 0 && !isForward) { tl1.play(); isForward = true; isBackward = false; } if(deltaPos < 0 && !isBackward) { tl1.reverse(); isBackward = true; isForward = false; } }); }); You can see it working here: http://jsfiddle.net/rhernando/PZB4y/ Now this is the common ground for scroll bars and this is not your case, I'm going to presume that you're using some custom scroll system or plugin, in that case you could replicate the code above considering what's in this post, all you have to do is use the logic of the $(window).scroll() function into the first setInterval function (getTop) of this fiddle. Unfortunately i couldn't set up a live example now, I'll get one during the afternoon, in the mean time I hope this helps you a little. Cheers, Rodrigo.
  6. Hi and welcome to the forums, I'm by no means an EA expert but I do know two things, first it works with JQuery plugins and you can do amazing things with GSAP (check Chris Gannon's blog), but beyond that I'm not going to be able to help you. you should try the Adobe Edge forums I've read some posts about working with JQuery plugins, and maybe you could try what Chris did in this post of his blog. I hope you can solve your question, it would be nice if you could drop by to tell us how you did it, and sorry for not being of more assistance. Cheers, Rodrigo.
  7. Hi, You also have some syntax issues here too. First once you have defined your tweens as variables in the add method you only put each variable name in the array, the DOM element and the variables to be tweened must go in the variable declaration, not in the add method array. Wrong syntax: var w = 25; var mc1 = new TweenMax(); var mc2 = new TweenMax(); timeline.add( [ mc1.to($('#selector'), 10, {backgroundColor:'red'}), mc2.to($('#selector'), 2.5,{width: w+"%", onComplete: function(){ timeline.pause() }}) ],0,0); Wright syntax: var w = 25; var timeline = new TimelineMax(); var mc1 = new TweenMax.to($('#selector'), 10, {backgroundColor:'red'}); var mc2 = new TweenMax.to($('#selector'), 2.5,{width: w+"%", onComplete: function(){ timeline.pause() }}); timeline.add([mc1, mc2],0,0); Second, in the update method you don't need to indicate the element and the time, only the vars to be changed. Also is not necessary to append, add or insert the update to the timeline, updateTo works as a function so you just use it on the variable you're updating. Wrong: timeline.append( mc2.updateTo($('#selector'), 5, { width: "50%", onComplete: function(){ timeline.pause()} }, false) ); Wright: mc2.updateTo({css:{ width: "50%"}, onComplete: function(){ timeline.pause()} }, false); And finally from the api reference: That is why in the code above you'll see this: mc2.updateTo({css:{ width: "50%"}, onComplete: function(){ timeline.pause()} }, false); Because since those values will be handled by the css plugin, and the tween has already started the tween element already has changed to that so the updateTo function it's going to look for width and is not going to find anything, but if you indicate that is a css plugin value the function will look for css.width and will update the corresponding tween. You can see the code working here: http://jsfiddle.net/rhernando/Zx4Vr/2/ Hope this helps, Cheers, Rodrigo.
  8. Hi Gabriel, Sorry for not getting it from the start As far as getting just one tween the best way would be to create a function and bind that to the particular events, something like this: $(document).ready(function(){ var status = $('#tablet-status'); //Initial tween, pulsating blue halo TweenMax.to(status,1,{boxShadow:'0px 0px 1px 1px blue', yoyo:true, repeat:-1}); function pulseHalo(e) { TweenMax.fromTo(e.data.element, e.data.time, {backgroundColor:e.data.Color, boxShadow:'none'},{boxShadow:'0px 0px 1px 1px' + e.data.Color, yoyo:true, repeat:-1}); } $(window).on('mousedown', {element:status, time:1, Color:'green'},pulseHalo); $(window).on('mouseup', {element:status, time:1, Color:'blue'},pulseHalo); }); You can see it working here: http://jsfiddle.net/rhernando/vUYH3/4/ Hope this time I got it and that it helps, Cheers, Rodrigo.
  9. Thanks for pointing that out Jack, I've corrected the code to this: $(window).mousedown(function(){ unclickStatus.pause(); clickStatus.play(0); }) $(window).mouseup(function(){ clickStatus.pause(); unclickStatus.play(0); }) The updated fiddle is here: http://jsfiddle.net/rhernando/vUYH3/3/ Cheers, Rodrigo.
  10. Hi Gabriel, It seems that you have some unnecessary code here that it's causing your trouble. For example if you indicate in the tween vars repeat:-1 the tween will repeat endlessly so you're going to get that blue or green halo pulsating around your element all the time. If what you're looking for is for the background to change and the box shadow having just one pulse (fade in and then fade out), you have to repeat the tween just once with yoyo: true, like this: var clickStatus = TweenMax.to(status,1,{boxShadow:'0px 0px 1px 1px green', paused:true, yoyo:true, repeat:1}); var unclickStatus = TweenMax.to(status,1,{boxShadow:'0px 0px 1px 1px blue', yoyo:true, repeat:1}) You can see it working here: http://jsfiddle.net/rhernando/vUYH3/1/ Another chance could be to not repeat the tween and reverse it on each mouse event, like this: var status = $('#tablet-status') var clickStatus = TweenMax.to(status,1,{boxShadow:'0px 0px 1px 1px green', backgroundColor:'green', paused:true}); var unclickStatus = TweenMax.to(status,1,{boxShadow:'0px 0px 1px 1px blue', backgroundColor:'blue', paused:true}); $(window).mousedown(function(){ clickStatus.play(0); unclickStatus.reverse(); }) $(window).mouseup(function(){ clickStatus.reverse(); unclickStatus.play(0); }) You can see it working here: http://jsfiddle.net/rhernando/vUYH3/2/ Hope this helps, Cheers, Rodrigo.
  11. Hi, Another alternative would be to put all the faces inside a container and rotate that container using the transform-style property, something like this: CSS .container { perspective: 500px; border: 1px solid black; margin:50px; background:#ccc; width:150px; } #cubeParent{ transform-style:preserve-3d; height:150px; width:150px; } #face1, #face2, #face3{ height:150px; width:150px; position:absolute; } #face1{ background:#00F; } #face2{ background:#f0f; } #face3{ background:#063; } The container style is just to have a reference of the cube's position, and the most important thing is that the #faceCube has transform-style: preserve3d, without that it doesn't works. HTML <p> <button id="btn1">Tween Faces</button><button id="btn2">Rotate Parent</button> </p> <div class="container"> <div id="cubeParent"> <div id="face1"></div> <div id="face2"></div> <div id="face3"></div> </div> </div> JS var tl1 = new TimelineMax({paused:true}), face1 =$("div#face1"), face2 =$("div#face2"), face3 =$("div#face3"), cubeParent = $("div#cubeParent"), btn1 = $("button#btn1"), btn2 = $("button#btn2"); tl1 .to(cubeParent, .5, {z:'-=75'}) .to(face1, .5, {rotationY:90, x:'-=75'}) .to(face2, .5, {rotationX:90, y:'-=75'}, '-=.5') .to(face3, .5, {rotationX:90, y:'+=75'}, '-=.5'); btn1.click(function() { tl1.play(0); }); btn2.click(function() { TweenMax.to(cubeParent, .5, {rotationY:'+=45'}); }); You can see it working here: http://jsfiddle.net/rhernando/PfPZm/ Hope this helps, Cheers, Rodrigo.
  12. Hi, I've updated the fiddle in order to make it work with images. http://jsfiddle.net/fFJ29/1/ Cheers, Rodrigo.
  13. Hi Jamie, That could be happening because you're tweening both the container and the div with the image, thus resulting in the sepia image taking a good shake in the process. One solution would be to translate both elements using x and y instead of using top and left, like that you could control the transform origin point, which could be helpful. But the best choice would be to tween the clip property of the container that holds the div with the sepia image, something like this: #mainCont{ width:400px; height:400px; background:#f0f; overflow:hidden; } #firstCont{ width:400px; height:500px; background:#0FF transparent; position:absolute; overflow:hidden; clip:rect(0px, 400px, 500px, 0px) } #childElem{ width:400px; height:400px; top:50px; left:50px; background:#00f; position:relative; } then the HTML:<div id="mainCont"> <div id="firstCont"> <div id="childElem">alo alo</div> </div> </div> And finally the JS:$(document).ready(function(){ var firstCont = $("div#firstCont"), child = $("div#childElem"), btn1 = $("button#btn1"), tn2 = new TweenMax.to(firstCont, 2, {clip:'rect(0, 0, 500, 0)', paused:true, repeat:1, yoyo:true}), tn1 = new TweenMax.to(firstCont, 2, {left:0, paused:true}); TweenMax.set(firstCont, {rotation:11, left:-41, top:-52}); TweenMax.set(child, {rotation:-11, top:50, left:50}); btn1.click(function() { tn2.play(0); }); }); You can see it in action here:http://jsfiddle.net/rhernando/fFJ29/ Hope this helps, Cheers, Rodrigo.
  14. Rodrigo

    Tutorials?

    Hi, Since this post came up, I started working in a tutorial about integrating GSAP JS with wordpress, but because of work and problems with the server where my blog was in I couldn't publish it before, therefore I don't know how useful can be right now, but I'm hoping that in the future it could help someone. It deals with the basic of using GSAP JS in wordpress and how can you use it on specific posts and pages: http://codeaway.info/incorporating-greensock-ap-js-into-wordpress/ Cheers, Rodrigo.
  15. Rodrigo

    clip in IE8

    Hi, As far as clip I haven't worked with it yet, so I couldn't tell you why is not working with IE8, but my guess will be that in order to make it work in IE8 could cause a performance problem (you just got to love IE8 ). As for a fallback is not that hard, check this post in order to see how: http://forums.greensock.com/topic/7256-ie-9-fallback-for-3d-transform/ Hope this helps, Cheers, Rodrigo.
  16. Rodrigo

    Swinging sign?

    Hi and welcome to the forums, You can see it in action here: http://jsfiddle.net/rhernando/qTSnC/3/ But since the css plugin supports css3 3D transforms all that workaround code is no longer necessary, you can achieve that with just a few lines of code and without including all the vendors prefix (the engine does it for you). It would be something like this: $(document).ready(function(){ var img1 = $("img#img1"), tl1 = new TimelineMax({paused:true}), btn1 = $("button#btn1"); //you set up the default perspective for all elements in the DOM CSSPlugin.defaultTransformPerspective = 400; //the point from which the sign is hanging TweenMax.set(img1, {transformOrigin:'50% 0%'}); tl1 .to(img1, .2, {rotationX:-20}) .to(img1, .2, {rotationX: 20}) .to(img1, 2, {rotationX:0, ease:Elastic.easeOut}); btn1.click(function() { tl1.play(0); }); }); You can see it in action here: http://jsfiddle.net/rhernando/qTSnC/4/ Hope this helps, Cheers, Rodrigo.
  17. Rodrigo

    home page popup

    Hi again, I set up a simple example so you can see it in action, the only problem is that I couldn't set up syntax highlighter properly and it look a little sterile in general, but is getting quite late around here so you'll have to look at the code with firebug or developer tools, but tomorrow I'll correct that situation. http://codeaway.info/sample.code/popup/ EDIT: I uploaded the syntax highlighter , so you can see the code of the sample. Cheers, Rodrigo.
  18. Rodrigo

    home page popup

    Hi, Is not too hard, you need to create the overlay (semi-transparent element over everything in the page), then the message element and finally the code so the message is always at the center of the page. First you have to write the css: html, body{ height:100%; margin:0; } #overlay{ height:100%; width:100%; background:#000; z-index:5000; position:fixed; top:0; left:0; } #messageBody{ background-color: #D9D9FF; width:800px; min-height:400px; border-radius:10px; box-shadow:0 5px 5px #000; position:fixed; z-index:5500; overflow:hidden; } Very important that the position of both elements is set to fixed, otherwise the user can scroll and they'll be out of the screen. Another thing to note is that I'm not sure how necessary is the html, body rule now a days, I'll keep using it but maybe someone with more updated knowledge in this regard could clarify that. Then you have to position the message body, a usual technique is to set the margin property to auto, but I prefer javascript because of cross browsing: var windowWidth = $(window).width(), windowHeight = $(window).height(), messageBody = $("div#messageBody"), overlay = $("div#overlay"), msgBdHeight = messageBody.outerHeight(), msgBdWidth = messageBody.outerWidth(), posTop = (windowHeight / 2) - (msgBdHeight / 2), posLeft = (windowWidth / 2) - (msgBdWidth / 2); //Set the elements initial state TweenMax.set(overlay, {autoAlpha:0, top:posTop, left:posLeft}); TweenMax.set(messageBody, {vars});//Here the rest is up to you, if you want //to set a scale up tween you should use a small scale , also could be a //fly by, etc., the sky is the limit. And finally you set up a timeline for showing the pop up, first you show the overlay and then the rest of the message, something like this: var tl1 = new TimelineMax({paused:true}), tl2 = new TimelineMax({paused:true}); tl1 .to(overlay, .25, {autoAlpha:.35})//here you can set how fast and how //transparent you want the overlay .to(messageBody, .5, {vars});//this will depend of the options you used //in the set tween for the body, and how you want your message to appear. Roughly that's how you could set up a popup message, the animations are up to you, because you have quite a handle of them to play around. One last advice will be that if your intention is to put a pop up in your home page, maybe you should consider a tracking cookie, so your visitors will see the pop up just once a day, or once every number of hours, because it could become somehow annoying to keep seeing the pop up every time you go to the home page or you load the page, unless the pop up will show on a user event like a mouse click, in that case don't pay attention to everything I wrote above. Hope this helps, Cheers, Rodrigo.
  19. Hi and welcome to the forums, You're right on using the tweenFromTo() method, the only thing missing is the callback to pause the timeline, something like this: var timeline = new TimelineMax({paused:true}), div1 = $("div#div1"); timeline .to(div1, 1, {autoAlpha:.2}, '00') .to(div1, 1, {scale:2}, '01'); //And now you tween to the specific label div1.mouseenter(function() { timeline.tweenFromTo("00","01"); }); div1.mouseleave(function() { timeline.tweenFromTo("01","00"); }); You can see it working here: http://jsfiddle.net/rhernando/ncX7j/1/ Edit: You should also consider use the tweenTo() method because using tweenFromTo() generates an immediate render, meaning if you leave the mouse before the tween is complete it goes immediately to the label "01" and then goes to the label "00", and if you put the mouse over before the reverse is complete it goes to the label "01" and then reverse to the label "00". Also in order to pause the timeline there is no need for callbacks, the timeline goes to the point indicated and no further. I updated the fiddle and the code. Here's the fiddle using the tweenTo() method: http://jsfiddle.net/rhernando/ncX7j/2/ Sorry for the initial mistake. Hope this helps, Cheers, Rodrigo.
  20. Hi and welcome to the forums, I've never worked with superscrollorama but it should be as simple as repeating the code you have in line 54 of the pastebin provided. Maybe you could post the code that's giving you trouble in order to see what maybe happening. Cheers, Rodrigo.
  21. Hi and welcome to the forums, Maybe the reason why tweenTo() isn't working is because when you use superscrollorama the timeline progress is set by the scroll position, therefore if you use tweenTo() it's very likely that the function is tweening your timeline, but the screen is not where the action is happening so you're not able to see your timeline being tweened. Now in order to get the pixel position of a specific label you need to know the label's relative position in the timeline and then associate it to the window scroll points in which your timeline is animated via superscrollorama (the values you give to superscrollorama when you set the function for that particular timeline). For example you have the following timeline: var tl = new TimelineMax({paused:true}); tl .to(div1, 5, {left:400}, 'label1') .to(div1, 4, {top:400}, 'label2') .to(div1, 1, {scale:2}, 'label3'); The timeline lasts 10 seconds, the first tween 5 seconds, the second 4 seconds and the third one just 1 second. The fisrt label is at 0 seconds, the second label is at 5 seconds and the third label is at 9 seconds. So using the getLabelTime() method you can get that value into a variable, and with the duration() method you get the timeline total time. With those values you can see at which position the label is in terms of the percentage of the timeline which is in other words the current progress of the timeline , and since superscrollorama works with start and end values of the window's scroll position you can relate that percentage with the scroll position. If you look at this tutorial I made some time ago you'll find this expression for relating the current scroll position with a tween/timeline progress: var progressNumber = (1 / (endPoint - startPoint)) * (getPos - startPoint); The breakdown is as follows: progressNumber: the progress of the tween/timeilne. endPoint: where the tween/timeline ends once you've scrolled there. startPoint: where the tween/timeline starts as soon as you've scrolled to that position. getPos: the current position of the window as you scroll up & down. var tlDuration, lab2Time, lab2Pos, tlDuration = tl.duration(); lab2Time = tl.getLabelTime('label2'); Since you know the starting and end position (values that you feed to the superscrollorama function) and you can calculate the timeline progress at a certain label, all you have to do is isolate the getPos value in the first expression: var tlDuration, lab2Time, lab2Pos, tlDuration = tl.duration(); lab2Time = tl.getLabelTime('label2'); The expression with the current variables will look like this: (lab2Time / tlDuration) = (1 / (endPoint - startPoint)) * (lab2Pos - startPoint); Since we know the progress value but not the lab2Pos variable value, we isolate it: lab2Pos = ( (lab2Time / tlDuration) * (endPoint - startPoint) ) + startPoint; And if we assume that the timeline begins at 400 pixels and ends at 3000 pixels, it will result in this: lab2Pos = ( ( 5 / 10) * (3000 - 400) ) + 400 = 1700 Finally in order to get your tween to that position and at the same time scroll the window you could use the scrollTo plugin, like this: TweenMax.to(window, 2, {scrollTo:lab2Pos}); You can see it working here: http://jsfiddle.net/rhernando/fdFFp/2/ Hope this helps, Cheers, Rodrigo.
  22. Hi, Another chance is to use outerWidth and outerHeight because with those properties you're considering padding and borders of the elements, so if for any reason they change, the function gets the new value immediately. It would be something like this: var cont = $("div#container"), contWidth = cont.outerWidth(), contHeight = cont.outerHeight(), div1 = $("div#div1"), div1Width = div1.outerWidth(), div1Height = div1.outerHeight(), div1CenterLeft = ( ( contWidth - div1Width )/2 ), div1CenterTop = ( ( contHeight - div1Height )/2 ), elemClick = false, tn1 = new TweenMax.to(div1, 1, {left:div1CenterLeft, top:div1CenterTop, scale:1.4, paused:true, boxShadow: '0px 5px 5px rgb(0,0,0)'}); Here you can see it in action: http://jsfiddle.net/rhernando/v85Zp/ Hope this helps, Cheers, Rodrigo.
  23. Right on Jack, that was my problem, I thought about the set call in the wrong way but I see know that is just a tween as any other, thus causing unwanted behavior but just because of how I used them. At the end invalidating the previous tween was the perfect solution. Thanks a lot for the explanations and patience Cheers, Rodrigo.
  24. Hi, There are three ways as far as I know, the first one is to change the vars object of the tween: tl.getChildren()[0].vars.css.top = -100; The downside of this method is that if the timeline has been already played the original value (-50px) is recorded and you can't change it, just like Jack explained it in this post. The other way I know to do that is by deleting the tween and then add the new tween at that label: var tl = new TimelineMax({paused:true}); tl.to(element, time, {css:{top: -50px}}, "my-label"); Then you remove the tween and add the new one at the same label: tl.remove(tl.getChildren()[0]); tl.to(element, time, {css:{top: -100px}}, "my-label"); This method forces you to know the index position of the tween you want to eliminate. And the last one is to add a new tween at the label without removing the previous one, like this you overwrite the old tween with the new one: tl.to(element, time, {css:{top: -100px}}, "my-label"); But in this case you're overpopulating your timeline and that may create a problem as well, but I couldn't tell you that, maybe Carl or Jack could. Hope this helps, Cheers, Rodrigo.
  25. Hi Jack, Thanks for the clarification and help to understand how things works. What I meant with the set calls is that I thought that by adding a set call at the beginning of the timeline I'd force the timeline to set to properties of the element when the timeline started, the point is that it also created a problem with other properties at the start of the timeline. Cheers, Rodrigo.
×
×
  • Create New...