At 15:25 -0700 21/7/09, Chris wrote: >If I have about 60 tooltips on page (that could load another subset of >elements, that maybe have tooltips too), I would have about 120 >listeners (each tooltip needs at least a mouseover and one mouseout, >right?). Is it the right way to just add two listeners (as in my >example in my first post), which fire only on the elements I want? >This would take the needed listeners from about 120 to only 2, which >seems to be a really nice thing. > >But if I do it with only two listeners, every time something is >hovered, it uses the findElement()-method to check for a tooltip. So >what is faster and less memory consuming?
At the risk of stating the bleedin' obvious - and maybe there's a good reason why you can't do this - have you thought about simply sing title attributes for the elements? In most, if not all, modern browsers, they produce tooltips when the element is rolled over. -- Cheers... Chris Highway 57 Web Development -- http://highway57.co.uk/ Computers in the future may weigh no more than 1.5 tons. -- 'Popular Mechanics', 1949 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
