簡體   English   中英

如何縮放整個div?

[英]How to zoom an entire 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});
    }
});

如果您將圖像的heightwidth更改為100%則只需更改div的大小,圖像應隨之縮放。

$('#who').animate({height: 600, width: 800});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM