I have a script that loops through an array of divs that adds a
mouseover/mousout event listener to each. However, I am finding that
as I move my mouse around within any of these divs that the mouseover
and mouseout constantly fires. This wasn't initially an issue (there
is no flickering or no noticeable side effects) until I tried to add a
time delay. I tried using event.stop() at the end of the mouseover and
mouseout and also tried setting the useCapture parameter on observe to
true. No luck. It seems like I may be missing something fundamental.
If anyone could share their thoughts, I would really appreciate it.

My code boils down to this:

function setupThumbnails()
{
        $$('div.myClassName').each(function(div)
        {
                div.observe('mouseover', function(event)
                {
                         ...do some stuff....
                           event.stop();
                }, true);

                div.observe('mouseout', function(event)
                {
                      ...do some stuff...
                     event.stop();
                }, true);
        });
}

Event.observe(window, 'load', setupThumbnails, true);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to