Jump to content
GreenSock

gern

Members
  • Posts

    4
  • Joined

  • Last visited

gern's Achievements

0

Reputation

  1. gern

    selectors

    Ah, thanks. My CSS was much simpler, so perhaps I didn't include some necessary details. Very good to know it works, though. Thank you!
  2. gern

    selectors

    Thanks, and yes. I don't normally use just the ID with javascript. I prefer to declare all my vars and grab them with document.getElementById(). That first sample of mine is just me getting my toes wet, so to speak, with GSAP and javascript. The background image problem I'm having is simple. I can tween a div with rotationX or anything else only when the image is in the background, as defined in the CSS: #cow {background-image: url('cow.jpg');} but if I put an image directly in the div, it won't tween: <div id="cow"><img src="cow.jpg"></div>
  3. gern

    selectors

    Okay, well, as usual, soon after I post the question I find the answer. I was trying to grab the document.getElementById code BEFORE that part of the DOM was loaded. Man, programming is hard.
  4. gern

    selectors

    Hi-- Just getting started with the JS version, but a long, long time user of the AS version, I'm having some trouble understanding selectors. I made a quick sample to learn the syntax and got this to work: $(function() { CSSPlugin.defaultTransformPerspective = 1000; TweenMax.set(cow, {rotationX: 90, transformOrigin:"left top"}); $( "#btn" ).click(function() { TweenMax.to(cow, 4, {rotationX:0, ease:Elastic.easeOut}); }); }); I'm not defining "cow" to be anything, but it does exist as an ID to a div. Great, I thought. Very easy, but when I try this on another file it didn't work. Same version of JQ and GSAP (TweenMax), but no go. So I tried this: var one = document.getElementById("one"); TweenLite.set(one, {left:300, top: "100px", transformPerspective: 600, rotationY:-10}); And it worked. Well, okay. Still, I started a third file and neither of these worked again. I had t to resort to: photos=new Array("#photo1","#photo2","#photo3"); TweenMax.set(photos[0], {transformOrigin:"left top"}); All using the same version of JQuery and TweenMax. What gives? Also, is there a reason I can only animate my divs when the images are in the background and not the foreground? Thank you!
×