在这个 fiddle 中,我希望仅旋转 div 的背景图像,当前 div 文本 This is div
也被旋转,我希望避免文本旋转。
代码:
.flippy {
/**/-moz-transform:scale(1,1);-webkit-transform:scale(1,1);
transform:scale(1,1);
/**/-webkit-transition:all 600ms ease;-webkit-transition:all 600ms ease;
transition:all 600ms ease; }
.flippy[flipped] {
/**/-moz-transform:scale(-1,1);-webkit-transform:scale(-1,1);
transform:scale(-1,1); }
#flippy1
{
border: 1px solid white;
background-color:red;
height:200px;
width:200px;
}
最佳答案
$('img.flippy').click(function(){
if ($(this).attr('flipped'))
$(this).removeAttr('flipped');
else $(this).attr('flipped','flipped');
});
关于jquery - div 背景和文本不同的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16935589/