Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does Firefox 3.6 alter jQuery and CSS properties?
    text
    copied!<p>Why does Firefox 3.6 alter jQuery and CSS properties?</p> <p>Alright, more specifically. I have a crossfade plugin to create a glow effect between two images that are placed on top of each other. The function (posted below) will make the top image transition to an opacity of 0 in 200 ms on hover and transition back to an opacity of 1 in 500 ms on hover-off. My problem is that the original image is not being displayed now within Firefox 3.6.6.</p> <p>HTML looks like this:</p> <pre><code> &lt;div id="logout-button"&gt; &lt;img class="fade" src='/img/test/control-logout.jpg' style="background:url(/img/test/control-logout-hover.jpg); border:none;"/&gt; &lt;/div&gt; </code></pre> <p>CSS looks like this:</p> <pre><code> #control-bar #logout-button{ float:right; margin:3px 30px 0 0; } #logout-button img.fade{ margin:-1px 0 0 0; width:33px; height:22px; cursor:pointer; border:none; } </code></pre> <p>jQuery functions page looks like this:</p> <pre><code> $(window).bind('load', function(){ $("img.fade").crossfade(); }); </code></pre> <p>jQuery Crossfade plugin looks like this:</p> <pre><code> $.fn.crossfade = function(){ return this.each(function(){ var $$ = $(this); var target = $$.css('backgroundImage').replace(/^url|[\(\)]/g, ''); $$.wrap('&lt;span style="position: relative;"&gt;&lt;/span&gt;').parent().prepend('&lt;img&gt;').find(':first-child').attr('src', target).css({border:'none'}); if(jQuery.browser.msie){ $$.css({position:'absolute', left:0, top:'0px', border:'none'}); }else{ $$.css({position:'absolute', left:0, top:'-6px', border:'none'}); }; $$.hover(function(){ $$.stop().animate({opacity: 0}, 200); }, function(){ $$.stop().animate({opacity: 1}, 500); }, 0); }); }; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload