http://msdn.microsoft.com/en-us/vcsharp/aa336760#WhereSimple1
On this page, when the code part being highlight and release mouse, the popup with code will appeared, is it javascript. how to code this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Probably attach an event listener to
onmouseupand check to see if the currently selected text is within the element, and if so, show the popup, populating it with the selected text. Most of that is pretty straightforward, but the part where you check to see if the text selection is fully contained within your target element will be a bit complex – mostly because you’ll be different code for different browsers. For older versions of IE, look atdocument.selectionanddocument.selection.createRange(). For others (including IE9) look atwindow.getSelection().