views:

205

answers:

4

Hello

i don't know if that's possible but i don't know anything about this, so i decided to ask. is it possible to rotate a div on x,y,z axises using javascipt library like Jquery ? or something like this?

Thanks

+2  A: 

You can position via x and y (left and top properties in CSS).

You will need to have position: absolute or something other than static.

You may also change the z-order (stacking height). Also works in conjunction with something besides position: static (which is default).

However, with CSS3 you can rotate a div.

#my-div {
    -webkit-transform: rotate(90deg); 
    -moz-transform: rotate(90deg);
}
alex
this just rotate the div on Y axis, what about X,Z axis ?
From.ME.to.YOU
You mean rotate into the page? Like skewing it? Might need to use Canvas for that.
alex
no, 3D rotate on X axis
From.ME.to.YOU
A: 

There is a jQuery addon to rotate (using the transform described in the other answer), but it doesn't work for IE.

If you are interested, check it out here.

If you want to rotate an image, this plugin will work for all browsers.

fudgey
A: 

AFAIK, no. There is nothing I know which can achieve that for the time being. To simulate a 3D rotation, the closest approach is to do it via some javascript canvas manipulation libraries. I happened to find a Javascript 3D renderer the other day. Check it out if you're interested. However, you should know that even with the Canvas 3d JS Library available, we won't be able to make a div (outside the canvas) to rotate in 3D.

shinkou
A: 

this jQuery plugin works for images, you could use it with divs

link

pixeltocode
how to rotate the div on X-axis ??
From.ME.to.YOU