Resize a div to smaller than its declared size?

前端 未结 6 1004
醉话见心
醉话见心 2021-02-07 14:50

Is there a way to resize a div to smaller than the declared height and width?

I\'m making an application where the user can resize a div and save it. However, when I loa

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 15:36

    $('.cls').css('height', 200);
    $(".cls").mouseup( function(){
    var height = $(".cls").height();
    var width = $(".cls").width();
    if(height>=200){
    $('.cls').css('height', 200);
    }
    if(width>=100){
    $('.cls').css('width', 100);  
    }
    var
    newdimensions="newheight="+height+"&"+"newwidth="+width;
    });
    

提交回复
热议问题