I made a copy of JSbin for practice, JSbin link here , the actual site here .
This is just the practice of creating front-end websites, since I just started learning web developers a little over a week ago. You can put html, css and javascript in the edit fields, and the page spits out in Output in the same way as the actual JSbin.
But the problem is that you can resize divs to pass other divs.
My idea to prevent this from happening:
1. get the current position of editboxes
2. Save the left / right position of the edit box if you resize it to 10% of the window width
3. set min / max left and right for the draggable div
And therefore the question. How to set max-left / right for draggable.
Also, any idea of why dragging before the output div has difficulty dragging to the right.
Edit: how the site is structured. When you drag .drag (.resize in my JSbin code), it changes the left and right divs left and right. And draggables are contained in the #main div.
<div id="main>
<div id="HTML"></div>
<div class="drag"></div> //drag this left and right to change the right of the HTML and left of CSS
<div id="CSS"></div>
<div class="drag"></div> //drag this left and right to change the right of the Css and left of JavaScript
<div id="JavaScript"></div>
<div class="drag"></div> //drag this left and right to change the right of the JavaScript and left of Output
<div id="Output"></div>
</div>
Run codeHide result
source
share