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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -