我从here这个旋转木马,我想添加一些css3转换选项。如何使用css3转换与jquery动画?
更确切地说:
-webkit-transform-style: preserve-3d;
-webkit-transform: rotateY(45deg);
在JavaScript
我有
if (newPosition == 1) {
new_width = pluginData.largeFeatureWidth;
new_height = pluginData.largeFeatureHeight;
new_top = options.topPadding;
new_zindex = $feature.css("z-index");
new_fade = 1.0;
} else {
new_width = pluginData.smallFeatureWidth;
new_height = pluginData.smallFeatureHeight;
new_top = options.smallFeatureOffset + options.topPadding;
new_zindex = 1;
new_fade = 0.4;
}
和动画功能在这里运行
.animate(
{
width: new_width,
height: new_height,
top: new_top,
left: new_left,
opacity: new_fade
}
生成的CSS是:
element.style {
width: 225px;
height: 115px;
top: 70px;
left: 50px;
opacity: 0.4;
z-index: 1;
}
现在,这一切都瓦尔正在这个插件计算,我只有在加入变换选择这个动画的功能,这样的事情感兴趣:
....
} else {
new_width = pluginData.smallFeatureWidth;
new_height = pluginData.smallFeatureHeight;
new_top = options.smallFeatureOffset + options.topPadding;
new_zindex = 1;
new_fade = 0.4;
new_transform_style = 'preserve-3d';
new_transform = 'rotateY(45deg)';
}
和
.animate(
{
width: new_width,
height: new_height,
top: new_top,
left: new_left,
opacity: new_fade,
transform_style = new_transform_style;
transform = new_transform;
}
但即时通讯不知道这些是正确的动画风格符号
有什么想法吗?
感谢
jQuery动画库不支持CSS3转换,它严格基于JavaScript。 – qJake 2012-04-12 21:09:24