I would like to implement resizable table columns, such that when you click and drag on a "notch" on the right side of the th
(just a styled div inside the th
), a new "marquee" element is created inside the th
and displayed as a guide for resizing.
(我想实现可调整大小的表列,这样,当您单击并拖动th
右侧的“凹口”(只是th
内的样式div)时,将在th
和内部创建一个新的“ marquee”元素显示为调整大小的指南。)
On mouseup, the marquee disappears and the th
element's width is set to the new width.(在mouseup上,选取框消失,第th
元素的宽度设置为新的宽度。)
I have created a fiddle to illustrate.
(我创建了一个小提琴来说明。)
It seems like the answer is to create a directive, but my main hangup is how to handle the dynamically-added window mousemove listener plus the "one" window mouseup listener within the directive logic.
(看来答案似乎是创建指令,但是我的主要难题是如何处理指令逻辑中动态添加的窗口mousemove侦听器以及“一个”窗口mouseup侦听器。)
ask by AndyPerlitch translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…