I am trying to create a “splitter” on a page, and while I’m somewhat happy with how it’s working, I’ve noticed that as I drag it back and forth some text inside the flanking divs is getting selected. Is there any way to avoid this?
[Here's a codepen I created that illustrates the problem](http://codepen.io/esdictor/pen/caieh “codepen example”)
Your calculating the position of your splitter incorrectly, so when the widths are set, it moved the splitter from under the cursor and give the div to left focus,
Also, calculating a left margin for the right div is not really needed either, just float all the divs to the left,
I also added some css to make the text none-selectable too, just encase we somehow slip off the Splitter
I forked your pen here
That works exactly how I wanted. Thank you very much for the solution.
You must be logged in to reply to this topic.