Explore the community Forums Lectora Tips and tricks Mouse position in pageDIV to variables Reply To: Mouse position in pageDIV to variables

#431742 Score: 0
Profile photo of CarlFink
LUC16 Attendee
wise owl
curious george
friend finder
41 pts

The idea is to have a ‘tooltip’ at the clicked word that gives more information. The tooltip is a text block with CSS styling. (speech-bubble style)

To prevent making dozens of identical speech-bubbles wirth identical texts, I want to create them in groups on title level and use alsways on top to show them above the course content.

Why not create a single popup and change the text in it using the Change Contents action? If you move it using JavaScript, I would expect the box-position-setting and mouse-position-getting functions to use the same coordinate system, so that wouldn’t be a problem. (I haven’t tested this and I have done only the most cursory JS work, so don’t assume I’m right.) You’d have to watch for overlap-edge-of-window (or -of-viewport) issues.

The last message in this thread might help you:

Tooltips in Lectora