From 19748d4b658ae0965f421da2ddde40eb9042ba63 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 22 Jul 2011 20:59:07 +0200 Subject: [PATCH] gallery: only hover the text when the cursor is over the image (Thanks xeen) --- js/gallery.js | 8 ++++---- js/gallery.min.js | 12 +----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/js/gallery.js b/js/gallery.js index 9524e71..284fb21 100644 --- a/js/gallery.js +++ b/js/gallery.js @@ -5,12 +5,12 @@ function initGallery() { $(document).ready(function() { $('.shot span').css('color', '#888'); - $('.shot').mouseover(function() { - $(this).children('span').css('color', 'white'); + $('.shot img').mouseover(function() { + $(this).parent().parent().children('span').css('color', 'white'); }); - $('.shot').mouseout(function() { - $(this).children('span').css('color', '#888'); + $('.shot img').mouseout(function() { + $(this).parent().parent().children('span').css('color', '#888'); }); // build an array of all images (full URLs) diff --git a/js/gallery.min.js b/js/gallery.min.js index f2f74fb..623d4ff 100644 --- a/js/gallery.min.js +++ b/js/gallery.min.js @@ -1,14 +1,4 @@ -/* - * jQuery hashchange event - v1.3 - 7/21/2010 - * http://benalman.com/projects/jquery-hashchange-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ function initGallery(){ (function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('