views:

49

answers:

3

I have problem with this JS code. When I started to test it, it is working properly with FF and Chrome but not with IE8.

I guess, something is wrong with IE visiblity property or the mouseover events. I tried everything but I am so deep in here I can't see the whole picture.

How can I make it run properly also in IE. Hate IE :))

$(document).ready(function() { 
      var doFadeIn = function() { 
         $('.aboutme').css({ opacity:0, visibility:'visible'}).fadeTo(900,1);
         }; 
         $('layout_aboutme').mouseover(doFadeIn); 
      var doFadeOut = function(){
         $('.aboutme').css({ opacity:0, visibility:'hidden'}).fadeTo(900,1);
         };
         $('layout_aboutme').mouseleave(doFadeOut);
  });
+1  A: 

You're looking for $('layout_aboutme') which isn't a valid Element. You probably mean the id $('#layout_aboutme') or class $('.layout_aboutme').

ps: $(function(){ ... }); is short for $(document).load(function(){ ... });

jerone
$('layout_aboutme') is an html tag that I created - no difference with $('p') or $('body') but I tried your solution still not working.
berk.
Seriously, you created `<layout_aboutme>...</layout_aboutme>`? This is quite invalid and won't work in IE (or some others).
bobince
A: 

i dont get why your assigning variable, anyway..

$(document).ready(function()
{
    $('.aboutme').mouseover(function(){
        $(this).css({ opacity:0, visibility:'visible'}).fadeTo(900,1);
    });
    $('.aboutme').mouseleave(function(){
        $(this).css({ opacity:0, visibility:'hidden'}).fadeTo(900,1);
    });
});

You should also read jerone's comment and sort out your selectors.

RobertPitt
Thanks but didn't work.
berk.
A: 

Solved.

I changed the html tags to the div tags with specific ids . It worked. when it was working with all browsers except IE, I assumed it is all about css styles but it wasn't.

thanks guys.

berk.