javascript - mobile safari 5 not responding to js events until further acton -
so check out http://www.toyota.ca/toyota/en/vehicles/yaris-hatchback/gallery using ios 5/mobile safari 5 or simulator press image on scroller @ bottom , lightbox pops. try press next button, noticed nothing happens. if zoom in/out or change orientation or scroll page, image change.
the js works because next/prev become enabled/disabled press them not animation part until further action. why this? common? if try same page on ios 4 work fine.
don't use click()
handler, use mousedown()
handler.
mobile devices have hard time discerning between click()
, mousedown()
.
the necessary change line 472 in common.js
, change
var o=p(f,c.prev).click(function(){b.prev()}),q=p(f,c.next).click(function(){b.next()});
to
var o=p(f,c.prev).mousedown(function(){b.prev()}),q=p(f,c.next).mousedown(function(){b.next()});
either that, or, every such navigation button, on creation, use:
$(selector).bind('mousedown',$(selector).data("events").click[0].handler) $(selector).unbind('click',$(selector).data("events").click[0])
where selector
jquery selector particular element.
or can use $(class).off
clear handler once , all.
Comments
Post a Comment