使用变量时背景不设置动画
Background not animating when using variables
我使用的是css转换,它是使用jquery为幻灯片添加的,尽管出于某种原因,它没有为元素的背景设置动画。
这是我正在使用的代码:
$(this).find('.pagers').children().css('-webkit-transition-property', 'background');
$(this).find('.pagers').children().css('-webkit-transition-timing-function', 'linear');
$(this).find('.pagers').children().css('-webkit-transition-duration', du);
$(this).find('.pagers').children().css('-moz-transition-property', 'background');
$(this).find('.pagers').children().css('-moz-transition-timing-function', 'linear');
$(this).find('.pagers').children().css('-moz-transition-duration', du);
$(this).find('.pagers').children().css('-o-transition-property', 'background');
$(this).find('.pagers').children().css('-o-transition-timing-function', 'linear');
$(this).find('.pagers').children().css('-o-transition-duration', du);
$(this).find('.pagers').children().css('-ms-transition-property', 'background');
$(this).find('.pagers').children().css('-ms-transition-timing-function', 'linear');
$(this).find('.pagers').children().css('-ms-transition-duration', du);
$(this).find('.pagers').children().css('transition-property', 'background');
$(this).find('.pagers').children().css('transition-timing-function', 'linear');
$(this).find('.pagers').children().css('transition-duration', du);
我不能仅仅使用常规css转换,因为我使用的是一个变量。
我已经尝试过用.animate代替它,尽管它不起作用。
http://jsfiddle.net/Hive7/uf5gE/
提前感谢
制作这样的东西:
$('.pager').css({
'-webkit-transition' : 'background-color '+du+'s linear'
});
当然,您必须为所有浏览器添加代码
相关文章:
- 设置动画时,SVG/Raphael大圆圈会变形
- jQuery animate()函数没有't设置动画
- 对象获胜'如果qml中的其他地方定义了数字动画属性,则t设置动画
- 如何在NativeScript中从列表中删除项目时设置动画
- angularjs路线过渡如何以交互方式设置动画
- 如何通过justinaguilar.com设置动画延迟?[解决]
- 当滚动条到达容器底部时设置动画
- 设置动画时jQuery停止侦听事件
- jQuery在模糊时设置动画-但仅当模糊超出形式时
- Reactjs在不使用插件的情况下为离开组件设置动画
- 在要设置动画的所有方法之间进行选择
- ng设置动画以创建slideIn/slideOut过渡
- 设置动画/移动putImageData放置的画布图像
- TweenSite不设置动画
- 使用jquery为html元素文本的每个字符设置动画
- 如何使用ngAnimate在CSS类之间设置动画
- 为已设置动画的元素设置动画
- scrollTop按钮没有't设置动画
- 可以使用jQuery'移动HTML背景吗;s设置动画
- 仅为父对象的填充设置动画