我现在正在玩一个函数这一页.
如果您单击“who”部分,div 就会旋转。我希望它能够缩放并使用页面。
这可能吗?如何才能做到这一点?
旋转后,将其宽度和高度设置为页面的宽度和高度。
$('#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);
}
});
See .height() and .width().
Edit #2
使用当前的 CSS,您需要缩放img
.
$('#who').rotate({
angle: -90,
bind: [{
click: function(){
$(this).rotateAnimation(0);
}
}],
callback: function (){
$('#who > img').animate({height: 600, width: 800});
}
});
如果你改变了,比如说,图像的height
and width
to be 100%
那么你只需要改变大小div
并且图像应该随之缩放。
$('#who').animate({height: 600, width: 800});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)