How to copy horizontal jsfiddle drag bar between HTML, JavaScript and CSS, Result

Jsfiddle has a feature that allows the user to resize windows for HTML, Javascript, CSS and results. I am trying to implement a similar feature on my website, with an article and comments. The comment panel moves horizontally to enlarge the comment section or enlarge the article.

In fact, I have a somewhat working drag and drop bar in jsfiddle itself (this is greatly simplified):

http://jsfiddle.net/Gp5as/2/

The problem is that the blue comment section is closed 25px, so when the panel is dragged to the right, the comment section is asymmetric.

There are two main parts:

<div class="main"> ... </div> 

and

 <div id="sidebar"> <span id="position"></span> <div id="dragbar"><div id="dragtext">Comments</div></div> <div id="comment-container"> <div id="comment"> Comments </div> </div> </div> 

The main thing for the article, and the sidebar for comments. The drag bar is located inside the sidebar float: on the left.

I am wondering how to implement my drag and drop function for my own purposes. You can modify my jsfiddle example or create a jsfiddle example that can be easily cut and pasted.

+8
jquery css jsfiddle
source share

No one has answered this question yet.

See related questions:

702
How do you easily center <div> horizontally with CSS?
493
How to set bullet colors to UL / LI html lists via CSS without using any images or span tags
231
How to widen the gap between text and underline in CSS
219
How to load CSS files using Javascript?
174
CSS div element - how to show only horizontal scrollbars?
10
Emulate frame resizing behavior with div using jQuery without using jQuery user interface?
2
jsFiddle to toggle JavaScript and CSS panels?
0
Partially hide flanking divs when resizing
0
the menu bar pops the previous divs, exposing the area behind it when the window is resized
-2
jsfiddle not working or my css / html?

All Articles