I know else if works on jQuery so where's the problem in this code:
if (document.location.href.indexOf('#1')) {
$(".products li").fadeIn();
}
else if (document.location.href === '#2') {
$(".products li").fadeOut();
$(".products li.2").stop(true,true).fadeIn(200);
}
else if (document.location.href === '#3') {
$(".products li").fadeOut();
$(".products li.3").stop(true,true).fadeIn(200);
}
else if (document.location.href === '#4') {
$(".products li").fadeOut();
$(".products li.4").stop(true,true).fadeIn(200);
}
else if (document.location.href === '#5') {
$(".products li").fadeOut();
$(".products li.5").stop(true,true).fadeIn(200);
}
else if (document.location.href === '#6') {
$(".products li").fadeOut();
$(".products li.6").stop(true,true).fadeIn(200);
}
else {
$(".products li").fadeIn();
}
If i put only if instead of else if it works but it's not correct.