i'm trying to hide title and alt tooltips from popping up.
i realized that tooltip plugins can hide the browser tooltip and display their own generated style. i am using plugins like fancybox and cycle which have been configured to use attributes for links and description therefore i need title/alt.
i've been unsuccessfully trying to write a function that onmousehover saves the title/alt attribute and empties the attributes (alt="" title="") so they don't popup, then restores them onmouseout.
i know it has something to do with .data() but I can't seem to get it working. i've tried breaking down very simple tooltip plugins, but once i start removing lines of code, it doesn't do anything.
use either firebug or the google chrome jconsole to see that the attributes are properly removed and added.
Edit: this works because the .each runs an anonymous function on each element, thus giving each element it's own scope in which to define savealt and savetitle. mouseover is bound to an anonymous function that removes the attributes, and then the mouseout event is bound to a closure(anonymous function that accesses a variable defined in a different scope) that adds the title and alt saved in the scope that the closure was defined in.