Prevent selection of text outside a scrolling element on Firefox
I am trying to prevent text selection outside a scrolling element; a div in this case which has its scroll-bars enabled.
This works perfectly fine on the rest of the browsers but not Firefox 22.0.
I added CSS classes[with -moz-user-select: none;] to elements I do not want to be selected (in order to prevent their selection) but when the scroll-bars of my selectable element (the element I want to select its text) are enabled and I am dragging my mouse up or down outside of it the selection seems to get inverted and other elements around it are getting selected instead.
Any ideas? I think I could have set the background color to transparent for the selection of surrounding elements but it would not work for me since the most important thing is the text that gets selected which contains text from other elements[which is not what I want].
Any ideas?
链接地址: http://www.djcxy.com/p/7108.html