Javascript/Jquery if statement and hasClass
<p>I have a bunch of images that have an opacity of 80%.<br>
When I hover over the image, I use <code>mouseenter</code> and <code>fadeTo('fast' 1);</code> to make the opacity 100%.<br>
When I hover away from the image, I use <code>mouseleave</code> and <code>fadeTo('fast' 0.8);</code> to get the opacity back to 80%.</p>

<p>BUT, if the image I hover over has a specific class, I want the opacity to stay 100%, and not change to 80% on mouse leave.</p>

<p>I tried but failed, I hope you guys can help me!</p>

<pre><code>$(document).ready(function(){

var subject = 'null';

$('.subject').mouseenter(function(){
    if ($(this).hasClass(subject) == false) {
        $(this).find('.info').fadeTo('fast', 1);
        $(this).find('img').fadeTo('fast', 1);
    }
});
$('.subject').mouseleave(function(){
    if ($(this).hasClass(subject) == false {
        $(this).find('.info').fadeTo('fast', 0);
        $(this).find('img').fadeTo('fast', 0.8);
    }
});


$('.english-link').click(function(){
    $('.english').find('.info').fadeTo('fast', 1);
    $('.english').find('img').fadeTo('fast', 1);
    var subject = 'english';
});
$('.math-link').click(function(){
    $('.math').find('.info').fadeTo('fast', 1);
    $('.math').find('img').fadeTo('fast', 1);
    var subject = 'math';
});
$('.electives-link').click(function(){
    $('.electives').find('.info').fadeTo('fast', 1);
    $('.electives').find('img').fadeTo('fast', 1);
    var subject = 'electives';
});
</code></pre>

<p>});</p>

<p><a href="http://jsfiddle.net/JDfpc/" rel="nofollow">http://jsfiddle.net/JDfpc/</a></p>
