jquery if parent exist else
<p>I need to know if parent exist then I need to do this else this. Here is the code:</p>

<pre><code>if ($('#block-slides p a img.alignleft').parent().length) {
        $(this).parent().parent().css({'max-width' : '100%', 'padding' :   '0'}).addClass('clearfix');
    } else {
        $('#block-slides p img.alignleft').parent().css({'max-width' : '100%', 'padding' : '0'}).addClass('clearfix');
    }
</code></pre>

<p>But nothing happen. Any help please?</p>
