JQuery fadeTo not working in IE8

I have a fading div when using fadeTo . It works fine in Firefox and IE9. It does not work in IE8. Here is my code:

Js

 var $j = jQuery.noConflict(); window.onload = function(){ $j('#fadein').fadeTo(6000, 1, function() { }); }; 

HTML

 <div class="img-center" id="fadein" style="opacity:0;"> <img src="src.jpg" alt="Text" class="feature-image" /> </div> 

How do I get this to work in IE8? I don't mind switching from fadeTo to fadeIn or some other method of fading into a div if it works in IE8.

+4
source share
1 answer

jQuery fadeTo () should work in IE8, however the element must have a β€œlayout”, see this in the β€œ haslayout ” section, and CSS syntax for opacity in crappy browsers:

 .transparent_class { /* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /* IE 5-7 */ filter: alpha(opacity=50); /* Netscape */ -moz-opacity: 0.5; /* Safari 1.x */ -khtml-opacity: 0.5; /* Good browsers */ opacity: 0.5; } 
+5
source

All Articles