可调整大小的div不在包含参数内 [英] Resizable div doesn't stay within containment parameter

查看:52
本文介绍了可调整大小的div不在包含参数内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调整中间div的大小时,它不会停留在网格右边界的containment参数内,也不会在左侧调整大小.

When resizing the middle div, it will not stay within the containment parameter on the right boundary of the grid, and it will not resize to the left.

http://jsfiddle.net/dKuER/8/(清晰的示例,已更新)

http://jsfiddle.net/dKuER/8/ (clear example, updated)

HTML

<div id='grid'>

    <div class='outline first top'>
        <div class='container'></div>
    </div>
    <div class='outline top'>
        <div class='container resizable'></div>
    </div>
    <div class='outline last top'>
        <div class='container'></div>
    </div>
    <div class='outline first bottom'>
        <div class='container'></div>
    </div>
    <div class='outline bottom'>
        <div class='container'></div>
    </div>
    <div class='outline last bottom'>
        <div class='container'></div>
    </div>

</div>

JS

$(document).ready(function() {
    $('.resizable').resizable({
        containment: "#grid", // Updated to reflect answer, but wasn't the issue.
        handles: "ne,se,nw,sw"
    });
});​

推荐答案

尝试:

containment: "#grid",

不受限制.

这篇关于可调整大小的div不在包含参数内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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