最佳答案
旋转后,将其宽度和高度设置为页面的宽度和高度。
$('#who').rotate({
angle:-90,
bind: [{
click: function(){
$(this).rotateAnimation(0);
}
}], // remove the trailing comma here
callback: function (){
var $window = $(window);
$(this).height($window.height()).width($window.width());
}
});
<小时/>
编辑回复:OP的评论
$('#who').rotate({
angle: -90,
bind: [{
click: function(){
$(this).rotateAnimation(0);
}
}],
callback: function (){
$(this).width(800).height(600);
}
});
<小时/>
编辑#2
使用当前的 CSS,您需要缩放 img
。
$('#who').rotate({
angle: -90,
bind: [{
click: function(){
$(this).rotateAnimation(0);
}
}],
callback: function (){
$('#who > img').animate({height: 600, width: 800});
}
});
如果您将图像的高度
和宽度
更改为100%
,那么您只需更改的大小code>div
并且图像应随之缩放。
$('#who').animate({height: 600, width: 800});
关于jquery - 如何缩放整个div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5222198/