使用jQuery调整2个依赖的引导程序列的大小-我的数学错误了吗? [英] Resizing 2 dependent bootstrap columns with jQuery - getting my math wrong?
问题描述
我有一个简单的引导程序布局,其中包含2列(4:8).
我想将列设置为 reizable ,因此我将jquery.resize()
用于实现最初成功.
I have a simple bootstrap layout with 2 column (4:8).
I want to make the columns resizable, so I used jquery.resize()
for that with some initial success.
但是,当我向左或向右拖动调整大小手柄(红色条)时,从属列的增长/收缩速度比主"列慢.我一定很想念东西.
However when I drag the resize handle left or right (the red bar) the dependent column grows/shrinks at a slower pace than the "master" column. I must be missing something.
我创建了一个小提琴示例来显示效果.注意:您需要使输出窗口变宽,以使各列彼此相邻显示.
I created a example fiddle that shows the effect. Note: you need to make the output window wide so the columns show next to each other.
我的问题:
- 如何同步"调整列的大小,以便蓝线和红线保持对齐
- 当拖动到右侧时,该列会扩展屏幕宽度,如何防止这种情况?
推荐答案
尝试一下 jsfiddle
我在调整大小事件中添加了$(masterDrag).css({left:'0px'});
.
I have added $(masterDrag).css({left:'0px'});
in the resize event.
这篇关于使用jQuery调整2个依赖的引导程序列的大小-我的数学错误了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!