fredleblanc / roundabout

A 3D Turntable jQuery Plugin.
645 stars 205 forks source link

focus event not catchable #118

Open Calius opened 11 years ago

Calius commented 11 years ago

It seems there's a bug, concerning the focus event. It does trigger, but it is not catchable by the on method. By changing the name of the focus event on line #458 i.e. .trigger("focus"); to something else, e.g. .trigger("infocus"); I was then able to catch the event with .on('infocus', 'img' function(){dosomething;});

I' using jQuery 1.10.1

Sensiblemnd commented 10 years ago

same here using Jquery 1.7.2 and roundabout 2.4.2

Sensiblemnd commented 10 years ago

Fix is this

Since blur and focus are event in jquery I think jquery ignores them.

To fix I did this if (inFocus !== info.inFocus) { // blur old child if (data.triggerBlurEvents) { self.children(data.childSelector).eq(info.inFocus).trigger("roundBlur"); }

                    data.childInFocus = inFocus;

                    if (data.triggerFocusEvents && inFocus !== -1) {
                        self.children(data.childSelector).eq(inFocus).trigger("roundfocus");
                    }
                }

notice I changed the triggers string to roundBlur and roundfocus. That fixed the issue