Replace your switch with
switch(Page){
case First:
alert("First");
$(".prev").closest('li').hide();
$(".next").closest('li').show();
break;
case Last:
alert("Last");
$(".prev").closest('li').show();
$(".next").closest('li').hide();
break;
default:
alert("Default");
$(".prev").closest('li').show();
$(".next").closest('li').show();
}
switch
implicitly checks equality with the specified cases; you yourself do not perform the comparison.
source
share