em
'ah, so that by default the line contains some number of characters considered readable (relative to a specific number, printers and Web-designers are still undecided, but not the essence), as well as We supplement it with an interface for setting the width. For example, so that you can drag the right border of the column, and double-click on it alternately plow up 100% (and then the width will be determined by the width of the browser window) or return the original width.jquery-ui-1.8.12.custom.css
, jquery-1.5.1.min.js
and jquery-ui-1.8.12.custom.css
, as well as our own - style.css
and onReady.js
. <div id="content" class="ui-widget-content"></div>
div#content{ width: 45em; margin-left: auto; margin-right: auto; padding: 1ex 1em; border-right: thin dashed #444444; }
$( function(){ $("#content").attr("start_width", $("#content").width()+"px"); $("#content").resizable({ handles: "e", start: function(){ $("#content").removeAttr("expanded"); } }); $("#content div.ui-resizable-handle.ui-resizable-e").dblclick( function(){ if($("#content").attr("expanded")) $("#content").width($("#content").attr("start_width")).removeAttr("expanded"); else $("#content").width("auto").attr("expanded", "expanded"); } ); } );
Source: https://habr.com/ru/post/118978/
All Articles