0

I have a logo and had to split it into a top and bottom section to try and achieve a spinning effect on the bottom portion of the logo.

Main goal is to take the bottom saw blade part of my logo and make it spin/rotate on hover.

I can make it spin/rotate, but since the logo is spit into two sections. I have to use z-index to stack the image and the bottom logo will not spin when it is lower than the top image because the top image is blocking the bottom image.

I tried using Jquery to solve the problem, but not to familiar with the coding yet.

Could someone please take a look at this CodePen and help me out.

Here is the link to the Pen / Code: http://codepen.io/daugaard47/pen/yKrdD

If you reverse the z-index you can see the spinning effect.

Thank you. -Chris

2
  • Can you create a demo fiddle? Commented Jun 2, 2013 at 4:58
  • Not on a computer to hover, but why not make the bottom half of the top image transparent? Commented Jun 2, 2013 at 5:02

1 Answer 1

2

Neat design!

heres a working version http://codepen.io/patrickkettner/pen/byFIl

You were really close - just a couple tweaks. Add the :hover listener to the wrapper, that way you don't need to worry about the stacking. Secondly, add a gpu hack (I used translateZ) to the animated element to prevent any flicker from the element jumping to the gpu to be animated and then back to the cpu to its resting state (check out http://www.youtube.com/watch?v=8uAYE5G1gSs for waaaay more information than you need to know on that topic).

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you so much! Been trying to figure this one out all night. Really appreciate it.
Checked out that video to. Understood about a 1/3 of what the hell they were talking about, (lol) but very interesting none the less. Thanks again.
@ Patrick one more question, different topic hope I don't get flagged for changing topics, but I've been struggling with creating fallback .png's for my .svg's . How would you go about doing this? You can use the same address for the images, just add the .png extension instead of .svg
My first instinct would be to check out modernizer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.