Skip to content

Commit

Permalink
Enforce redraw of fancybox wrap
Browse files Browse the repository at this point in the history
In Webkit-based browsers, if your mousecursor is exactly at the position
of the next-button while fancybox slides in, you have to click twice to
get to the next image because the first click gets eaten by Webkit to
check the :hover state of the 'a' element used for the next-button.

If we enforce a redraw by doing a hide().show(0), Webkit will reevaluate
the :hover state and the first click will trigger an click event like
expected.
  • Loading branch information
freshprince committed Oct 3, 2013
1 parent fbc8acc commit 46f3dc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/jquery.fancybox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@

F.isOpen = F.isOpened = true;

F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0);

F.update();

Expand Down

0 comments on commit 46f3dc5

Please sign in to comment.