如何缩放整个div?
我现在正在这个页面上愚弄一个函数。
如果单击div旋转的“who”部分。 我希望它能够缩放和使用页面。
这可能吗? 如何才能做到这一点?
旋转后,将其宽度和高度设置为页面的宽度和高度。
$('#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); } });
请参阅.height()
和.width()
。
编辑#2
使用当前的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});