From c6b520503981cabf29a25fb647e0b968b2293569 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 23 Jul 2011 15:26:58 +0200 Subject: [PATCH] Bugfix: Append the element to the DOM before setting 'left' etc. Fixes the slide-in animation in Firefox 3.5 --- js/gallery.js | 2 +- js/gallery.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/gallery.js b/js/gallery.js index 8811860..a1724fb 100644 --- a/js/gallery.js +++ b/js/gallery.js @@ -79,6 +79,7 @@ function initGallery() { $('#loading').hide(); var element = $(''); element.attr({ 'src': url, 'width':dims.width }); + $('#maskinner').append(element); element.css({ 'z-index': 21, 'position': 'absolute', 'top':dims.top + 'px', 'left':dims.left + 'px' }); if (direction !== undefined) { // slide from right to left @@ -94,7 +95,6 @@ function initGallery() { }); } } - $('#maskinner').append(element); $('#maskinner').show(); $('#bigimg').show(); diff --git a/js/gallery.min.js b/js/gallery.min.js index a2bafac..f57a8fb 100644 --- a/js/gallery.min.js +++ b/js/gallery.min.js @@ -1,4 +1,4 @@ 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=$('