Emulating frame-resize behavior with divs using jQuery without using jQuery UI?

坚强是说给别人听的谎言 提交于 2019-11-28 07:00:15

Look at http://www.jsfiddle.net/gaby/Bek9L/

I changed the #main area to be left:200px (and no width).
Added e.preventDefault() on the mousedown to avoid the selection of text to occur.
In the code i alter the left property of the #main as well so both sides move..


Not sure what you problem really is, but what is see is that the #sidebar was resized but was going underneath the #main and so the #dragbar disappeared..

Use event.preventDefault.

$('#dragbar').mousedown(function(e){
   e.preventDefault();
   // ...
});

Maybe you need to call it in mousemove too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!