Jump to content
Search Community

kkranzo

Members
  • Posts

    4
  • Joined

  • Last visited

kkranzo's Achievements

0

Reputation

  1. So, here is another question about the smoothness of animations and how I can get them to be smoother. I have a carousel that has 5 "slides" in it and 5 external buttons that move a slide into view (the div is 940 x 357) upon rollover/hover. This works great when you just slowly rollover the buttons in a slow fashion. But if you hover over them fairly quickly things start to get choppy and some glitches happen. It sometimes even happens every so often when you go slow (you'll rollover a button and it will just show the slide rather than animating it in). I was thinking maybe there were some overwrite issues going on, but I tried all the different overwrite settings and it didn't help. Can you see why that would be from my code snippet below? previousSlide = document.getElementById("slide" + activeSlide); showSlide = document.getElementById("slide" + slideNumber); previousSlide.style.zIndex = 7778; showSlide.style.zIndex = 7779; if (activeSlide < slideNumber) { showSlide.style.visibility = "visible"; TweenMax.to(previousSlide, .5, {css:{left:"-940px"}, ease:Circ.easeOut, onComplete:hidePrevious}); showSlide.style.left = "940px"; TweenMax.to(showSlide, .5, {css:{left:"0px"}, ease:Circ.easeOut}); } else if (activeSlide > slideNumber) { showSlide.style.visibility = "visible"; TweenMax.to(previousSlide, .5, {css:{left:"940px"}, ease:Circ.easeOut, onComplete:hidePrevious}); showSlide.style.left = "-940px"; TweenMax.to(showSlide, .5, {css:{left:"0px"}, ease:Circ.easeOut}); }
  2. I have a bunch of divs/boxes on the page that will contain images of the same size. I have set the overflow for each of the divs to hidden so that I can have a nice zoom animation on each of the images within upon rollover (scale 1.1). I am using TweenMax along with jQuery and I am able to get the script to fire for each div on the page, however the TweenMax part is not working. The image is not scaling up. Am I not using "this" correctly to target whichever div is being hovered over? Here is my code: <style type="text/css"> #tile { width: 300px; height: 250px; overflow: hidden; } .tileImage { width: 300px; height: 250px; background-image: url(image.gif); background-position: center center; } </style> <script language="JavaScript" type="text/javascript"> $('.tileImage').hover( function () { TweenMax.to(this, 2, {scaleX:1.1, scaleY:1.1, ease:Circ.easeOut}); }, function () { TweenMax.to(this, 2, {scaleX:1, scaleY:1, ease:Circ.easeOut}); } ); </script> And here is the code I have for the html: <div id="tile"> <div class="tileImage"></div> </div> Any help would be greatly appreciated! Thanks.
  3. I am trying to create a flip using TweenMax shortRotation. Basically, I want to have a box with content on it. And when the user clicks a button it would flip on the Y axis and reveal different content on the "back" of the card. Right now I have it working so the square flips like it should using: TweenMax.to(box_mc, 1, {shortRotation:{rotationY:180}}); However, I need to setup the content that appears above the box to disappear/appear in a way so that it looks like the box is actually flipping. One way I was thinking of doing this is having a movieclip with the front content within the box_mc and a movieclip with the back content within the box_mc as well. And when the shortRotation animation is half way done it would make the front movieclip invisible and the back movieclip visible. I was thinking the best way to accomplish this would be to just do this: TweenMax.to(box_mc, 1, {shortRotation:{rotationY:180}}); TweenMax.delayedCall(.5, switchBox); function switchBox() { box_mc.front_mc.visible = false; box_mc.back_mc.visible = true; } This works pretty good. However, the back_mc ends up being flipped horizontally. What would be the best way to accomplish flipping something (with content on the "front" and content on the "back") using shortRotation? Thanks for your help!
×
×
  • Create New...