Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flipping around a div using Javascript

Flip is a great JQuery plugin for flipping blocks, but it doesn't preserve the background while it animates the flip.

For example, I have this pretty background here, before I flip. While flipping, it gets ugly.

Is there a way I can flip this div nicely, keeping the pretty background I have, and maybe even achieve a smoother animation than I can get with Flip?

If I need to dive into this headfirst and code my own function for flipping a div, that's also doable, and I'd really appreciate some pointer there, if that's what I must do.

Thanks so much!

like image 465
Isaac Avatar asked May 02 '10 18:05

Isaac


3 Answers

Try the jQuery QuickFlip pulgin, this one seems pretty neat with handling the background.

like image 64
Nagaraj Hubli Avatar answered Nov 20 '22 07:11

Nagaraj Hubli


Try looking into momoflow, its a coverflow type of application that animates the background to different angles.

It's using the canvas tag however, which could be an issue for you if you want IE compatibility. However the technique the dev is using is to chop the the image into several vertical slices and animate their position. You could extend this functionality to introduce a full flip!

like image 45
Ben Rowe Avatar answered Nov 20 '22 09:11

Ben Rowe


A really cool way to do this is use CSS 3 transformations. It's much better than using a script; you should always avoid using scripts where simpler methods can be employed.

like image 1
Delan Azabani Avatar answered Nov 20 '22 07:11

Delan Azabani