我有这对应该调整点击的div,它可以很好地工作,除了每隔一段时间div类型在调整大小之前闪烁。我做了大量的研究,每个人都同意它应该修复“-webkit-backface-visibility:hidden;”但我已经尝试过了,并没有改变任何东西。它在Chrome和Firefox中都失败了。我的意思是有时候它可以正常工作,而其他时候它会非常可怕地闪烁。CSS转换错误
有什么不对? 它在jQuery中吗?在CSS?
任何帮助表示赞赏。
我的JS:
(函数($){
setup = function setup(){
var windowWidth;
$('.day').each(function(){
var $this = $(this),
links = $('.links', $this),
images = $('.images', $this),
largeWidth,
smallWidth,
linksWidth,
imagesWidth;
images.click(function(){
windowWidth = $(window).width();
linksWidth = $('.links', $this).width();
imagesWidth = $('.images', $this).width();
largeWidth = Math.max(linksWidth,imagesWidth);
smallWidth = Math.min(linksWidth,imagesWidth);
if (windowWidth < 850){
images.width(largeWidth);
links.width(smallWidth);
}
})
links.click(function(){
windowWidth = $(window).width();
linksWidth = $('.links', $this).width();
imagesWidth = $('.images', $this).width();
largeWidth = Math.max(linksWidth,imagesWidth);
smallWidth = Math.min(linksWidth,imagesWidth);
if (windowWidth < 850){
links.width(largeWidth);
images.width(smallWidth);
}
})
});
}
$(document).ready(setup);
}(jQuery))
而CSS:
.column {
width: 50%;
float: left;
overflow: hidden;
-webkit-transition: width 0.3s linear;
-moz-transition: width 0.3s linear;
-o-transition: width 0.3s linear;
transition: width 0.3s linear;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-webkit-perspective: 1000;
-webkit-transform:translate3d(0,0,0);
-webkit-transform: translateZ(0);
}
这里是的jsfiddle:http://jsfiddle.net/cKvYq/2/
非常感谢
你最终解决您的问题? –