From 1ba6003c812a0b590b60a9b6fa28610766300f6b Mon Sep 17 00:00:00 2001 From: undido Date: Fri, 26 Sep 2014 17:34:34 -0300 Subject: [PATCH] Fixed bug with webm, image-hover closes when you click an image to expand it to expand it inline --- js/image-hover.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/image-hover.js b/js/image-hover.js index c752a2cf..cebb94d6 100644 --- a/js/image-hover.js +++ b/js/image-hover.js @@ -24,12 +24,22 @@ $(document).ready(function(){ imageHover = !imageHover; var imageEnter = function(){ + if (!imageHover) return; + //don't hover-image if image expanded + if ($(this).parent().attr("data-expanded") == "true") + return; + mouseexitedImage = false; mouseisOnImage = false; - + //remove hover-image if user clicks on image to expand it + $(this).click(function(){ + mouseexitedImage = false; + mouseisOnImage = false; + $("#hover-image").remove(); + }); isVideo = (($(this).prop("tagName") == "VIDEO") ? true:($(this).parent().attr("href").indexOf("player.php?v=") > -1) ? true:false); maxWidth = document.body.offsetWidth-(document.body.offsetWidth * 0.25); maxHeight = document.documentElement.clientHeight;