javascript - Is there a onselect event for non-form elements? -


say want hide span when user highlights bit of text containing span, intention of copying text on clipboard.

for example:

<p>the dragon <span class="tooltip">a large, mythical beast</span> belched fire @ st. george.</p> 

i have found in firefox mac, span.tooltip disappear view (in accordance css declarations) show in clipboard when it's copied there. figured (wrongly?) if said "onhighlight, hide tooltip," maybe wouldn't happen.

though may more complicated, why not have onmousedown event on <p> element, , thet event attach onmousemove event , onmouseout event, if there mouse movement, while button down, remove class on span elements, , once user exits, element can put them back.

it may bit tricky, , may want key presses, or determine other times want know when put css classes, 1 option, believe.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -