From b371dffd6d5f06cb23a5b38bdcb5cf292f910aa1 Mon Sep 17 00:00:00 2001 From: Jeff Sawyer Date: Mon, 3 Oct 2016 14:23:08 -0700 Subject: [PATCH] forces a click event using element.click(); adding element.click(); to force a click event after the MouseUp. In some browsers (firefox), I was seeing an issue where the combination of mousedown and mouseup event listeners with the transform css3 code were interfering with the click event ever firing. This means that using this code in collaboration with a jQuery fancybox would not work. This was a simple hack/workaround and I'm not sure if this is the _best_ way have fixing this issue, but it worked for me. --- js/tileJs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/tileJs.js b/js/tileJs.js index 2fe28a5..7fed053 100644 --- a/js/tileJs.js +++ b/js/tileJs.js @@ -145,6 +145,8 @@ function Tile( element ){ tile.style.transform = idleCss; document.removeEventListener('mouseup', MouseUp, false); + element.click(); + }; // Element position finding for non webkit browsers. @@ -188,4 +190,4 @@ for ( i = 0; i < tileElements.length; i++ ) { Tile( tileElements[i] ); -} \ No newline at end of file +}