Tracking mouse movement with tooltips
So far, we've had a look at how to add tooltips to your page, and covered some of the possibilities for styling and positioning them on screen. One small enhancement we can make to our tooltips is to set them so that they can follow your cursor, when activated.
This is a simple change to make; change the body of tooltip5.html
so it contains the following elements:
<div id="content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla blandit mi quis imperdiet semper. Fusce vulputate venenatis fringilla. Donec vitae facilisis tortor. Mauris <a href="#" rel="tooltip1"title="This is a tooltip hovering over a link">dignissim</a> nibh ac justo ultricies, nec vehicula ipsum ultricies. Mauris molestie felis ligula, id tincidunt urna consectetur at. Praesent blandit faucibus ante ut semper. <a href="#" rel="tooltip2" title="Here is another tooltip">Pellentesque non tristique</a> nisi. Ut hendrerit tempus nulla...