This example shows how to make all links on a webpage spoken when the mouse hovers over them.
This could be improved by adding a small delay before speaking, to avoid mouse travelling over links without the intention of speaking them. (see: http://stackoverflow.com/questions/14834035/jquery-if-hover-more-then-5-seconds-then-show-div)
This is example code to add just before the closing body tag.
1 2 3 4 5 6 |
<script> $('a').mouseenter(function() { // Attach this function to all mouseenter events for 'a' tags responsiveVoice.cancel(); // Cancel anything else that may currently be speaking responsiveVoice.speak($(this).text()); // Speak the text contents of all nodes within the current 'a' tag }); </script> |
Keywords: hover, mouseover, mouseenter, mouseleave, menus, links