相关疑难解决方法(0)

如何用JavaScript更改元素的类?

如何onclick使用JavaScript 更改HTML元素的类以响应事件?

html javascript dom

2650
推荐指数
22
解决办法
248万
查看次数

旋转期间Chrome 21缩放元素

我认为这是最新Chrome(21.0.1180.57)中的一个错误,但我想我会在这里发帖只是为了仔细检查.

我正在使用javascript更改元素的旋转,并使用webkit过渡来为旋转设置动画.有时,根据开始和结束旋转,元素随着旋转随机缩放.我在这里做了一个演示:http://jsfiddle.net/XCwUQ/(点击正文).

有谁知道为什么会发生这种情况?

干杯,

基督教

google-chrome rotation css3 css-animations

14
推荐指数
1
解决办法
370
查看次数

如何立即删除css过渡?

我希望顺利转换css属性然后我想立即更改css属性值然后我想再次附加转换.为了更好地理解,请参阅以下示例:

if ($(".marquee").height() < $(".marquee-content").outerHeight(true)) {
  $(".marquee-content").clone().appendTo($(".marquee-wrapper"));
}
$('.marquee-wrapper').css("transition", "transform 3s linear");
$('.marquee-wrapper').css("transform", "translateY(-" + $(".marquee-content").outerHeight(true) + "px)");

setInterval(function() {
  
  $('.marquee-wrapper').css("transition", "none");
  $('.marquee-wrapper').css("transform", "translateY(100px)"); //This should Immediately change translateY to 100px without smooth transition. But this doesn't happen without adding a delay before the below written line
  
  // Its weird why javascript engine executes the below line before executing this line

  $('.marquee-wrapper').css("transition", "transform 3s linear");
  $('.marquee-wrapper').css("transform", "translateY(-" + $(".marquee-content").outerHeight(true) + "px)");

}, 3000);
Run Code Online (Sandbox Code Playgroud)
.marquee {
  margin: auto;
  width: 600px;
  height: …
Run Code Online (Sandbox Code Playgroud)

javascript css jquery css-transitions

10
推荐指数
1
解决办法
1780
查看次数