cleaner shorter code for if else

cleaner shorter code for if else

Hi all,

I have this piece of code:

var $arrowBackward = $("#arrowBackward");
var $arrowForward = $("#arrowForward");
if ( nextWorkChart==1 ) {
$arrowBackward.fadeOut(300, 'linear');
} else {
$arrowBackward.fadeIn(300, 'linear')
};
if ( nextWorkChart==13 ) {
$arrowForward.fadeOut(300, 'linear');
} else {
$arrowForward.fadeIn(300, 'linear');
};

it is needed to fadeOut/In arrows if the user reaches (by several ways) the beginning or the end of a slider, so that reaching the first picture the backward arrow appears and other way around if he reaches the last one the forward arrow disappears. Naturally they have to reappear if the user moves from there on again.

I am sure there is a shorter more elegant way to do those kind of things.

Some ideas out there?

Thanks for any help

Garavani