0

I just uploaded a new site and noticed after a while (my fault) that the fade in/fade out effect on the navigation menu does not work on IE. It's driving me crazy because it works perfectly in all other browsers. Any ideas why?

Here is the link to the site: http://www.sveiki-constructions.com And here is the jquery:

$(document).ready(function(){
    function preload(arrayOfImages) {
            $(arrayOfImages).each(function(){
               $('<images/>')[0].src = this;

    });
    }
    preload([
    'home_default.jpg',
    'home_lowbudget.jpg',
    'home_coldroom.jpg',
    'home_cleanroom.jpg',
    'home_distribution.jpg',
    'home_distribution.jpg',
    'home_mini.jpg',
    'home_panels.jpg'

    ]);



    $('.link ').hover(
        function(){
            $(this).css({'background-color':'#333333'});

            var imgloc= $(this).find('a').attr('alt');
            var oldpic =$('.homeContainer .image img');
            var oldsrc= $(oldpic).attr('src');
            var newpic =$('<img src="images/' + imgloc + '.jpg">');
            var newsrc= $(newpic).attr('src');

            if(newsrc !== oldsrc){
                $('.homeContainer .image').prepend(newpic);
                newpic.hide();
                newpic.fadeIn(500); 
                oldpic.fadeOut(500, function(){
                    $this.remove();
                });
                }

            },
            function(){
            $(this).css({'background-color':'#1c3261'});
            })

        $('.homeContainer .image').prepend('<img src="images/home_default.jpg">');

});
Fabrício Matté
  • 69,329
  • 26
  • 129
  • 166
Eduardo Plaza
  • 29
  • 2
  • 7

2 Answers2

0

According to this post, you might need to add the filter to your CSS:

$('<your menu selector>').css('filter', 'alpha(opacity=0)'); // or 100 for fadeout 1st
Community
  • 1
  • 1
JScoobyCed
  • 10,203
  • 6
  • 34
  • 58
0

IE console says "$this" undefined.

You have an error on your fadeOut, try to replace it with this:

 oldpic.fadeOut(500, function(){
     $(this).remove(); 
 });
Code-Source
  • 2,215
  • 19
  • 13
  • Thank you very much. That was it. A simple error... where can I get that IE console? I don't have it installed. Have nice day! – Eduardo Plaza Feb 06 '13 at 02:49