div的最小高度和宽度 [英] miminum height and width of a div

查看:99
本文介绍了div的最小高度和宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有一个可调整大小且可拖动的div
我想限制用户将DIV的大小调整为固定的最小宽度或高度,并且不能调整更多.

我确实使用以下代码尝试了它,但没有帮助.
请指导我解决这个问题.

I have a re-sizable and drag able div in my page
I want to restrict users to re size the DIV to a fixed minimum width or height and cannot resiz more than that.

i did try it using the following code but it did not help.
please guide me to solve this.

$("#dv_move").resizable({
               resize: function () {
                   var t = $(this);
                   if (parseInt(t.width()) < 300 || parseInt(t.height()) < 150)
                       return false;
               }
           });

推荐答案

(" ).resizable({ 调整大小:功能(){ var t =
("#dv_move").resizable({ resize: function () { var t =


( this ); 如果( parseInt (t.width())< 300 || parseInt (t.height())< 150 ) 返回 ; } });
(this); if (parseInt(t.width()) < 300 || parseInt(t.height()) < 150) return false; } });


我自己做到了
这有效
I did it my self
this works


这篇关于div的最小高度和宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆