Jquery If/Else Statement Problems

Jquery If/Else Statement Problems

Hi everyone,

So what I am trying to make is letting the opacity stay at 1 if the usernameField
or passwordField is focused when the loginField is not hovered anymore. 
When the loginField is not hovered, than the opacity needs to change to 0.5 (to its original state).

So can anyone help me what I am doing wrong here?

  1. $('.loginContent').hover
        (function()
        {
            $(this).stop(true, true).animate({'opacity' : 1}, 500);
        },
        function()
        {
            if ($('.usernameField').focus() == true || $('.passwordField').focus() == true)
            {
                //Opacity stays at 1.
            }
            else
            {
                $('.loginContent').animate({'opacity' : 0.5}, 500);
            }
        });
















Thanx