【发布时间】:2011-03-08 01:55:39
【问题描述】:
【问题讨论】:
【问题讨论】:
旋转后,将其宽高设置为页面的宽高。
$('#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());
}
});
$('#who').rotate({
angle: -90,
bind: [{
click: function(){
$(this).rotateAnimation(0);
}
}],
callback: function (){
$(this).width(800).height(600);
}
});
使用您当前的 CSS,您需要缩放 img。
$('#who').rotate({
angle: -90,
bind: [{
click: function(){
$(this).rotateAnimation(0);
}
}],
callback: function (){
$('#who > img').animate({height: 600, width: 800});
}
});
如果您将图像的height 和width 更改为100%,那么您只需更改div 的大小,图像就会随之缩放。
$('#who').animate({height: 600, width: 800});
【讨论】:
$window.height()?您是否尝试将图像本身设为 800 x 600?在这种情况下,您根本不需要 $window 部分,只需使用:$(this).height(600).width(800);。