Can I reduce this jquery script down to one line?
<p>I have written this code</p>

<pre><code>if (forw == true)
    {
    if ($('.tickertape li.active')[0] != $('.tickertape li').last()[0])
        {
        $('.tickertape li.active').removeClass('active').next().addClass('active');
        }
    else
        {
        $('.tickertape li.active').removeClass('active');
        $('.tickertape li').first().addClass('active');
        }
    }
else
    {
    if ($('.tickertape li.active')[0] != $('.tickertape li').first()[0])
        {
        $('.tickertape li.active').removeClass('active').prev().addClass('active');
        }
    else
        {
        $('.tickertape li.active').removeClass('active');
        $('.tickertape li').last().addClass('active');
        }
    }
</code></pre>

<p>Which works but really feels like it should only be on one line. This there a way to do this?</p>
