Splitter using jQUery UI library [closed]

社会主义新天地 提交于 2019-12-24 02:57:16

问题


I am trying to create resizable cells (Splitter) like the one below http://methvin.com/splitter/3csplitter.html

But I need to do that using jQUery UI.

I am not sure how similar thing can be achieved using jQUery UI.

Is it possible using the jQuery UI Resiable(http://jqueryui.com/resizable/)

If yes, could you please provide any reference example for the same. It should behave similar to the Methvin.com/splitter


回答1:


This is the code I used one day:

$(".resizable1").resizable({
    handles: 'e',
    minWidth: '50',
    maxWidth: '350',
    resize: function() {
        var remainingSpace = $(this).parent().width() - $(this).outerWidth(),
            divTwo = $(this).next(),
            divTwoWidth = remainingSpace - (divTwo.outerWidth() - divTwo.width());
        divTwo.width(divTwoWidth);
    }
});

http://jsfiddle.net/8qzTJ/




回答2:


This is definitely possible with the jquery ui, check out the docs here http://jqueryui.com/resizable/#helper this is just a short hand example

$(function() {
    $( "#resizable" ).resizable({
      handles: "n,e,s,w" // chose the handle you want
    });
  });


来源:https://stackoverflow.com/questions/15319834/splitter-using-jquery-ui-library

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