Here is an example of what I have already
The main functionality works, but now I need to make the controller list smaller, so that it fits better to the screen, as it's fixed positioned.
So, I think it should show next three list-items from active item and 2 previous ones.
Something like this would work, but I think there should be shorter and more convinient way:
//Display closest items
$('#historyController li.active').prevAll('li:not(.first)').hide().slice(0,2).show();
$('#historyController li.active').nextAll('li:not(.last)').hide().slice(0,3).show();
Any tips for re-factoring current code for better performance would be helpful as well.
Something like this would work, but I think there should be shorter and more convinient way
orany tips for re-factoring current code for better performance would be helpful as well
If nothing is broken and your code works but you are simply looking for an alternative or better approach, this question might be better of on Stackexchange - Code Review – Carryingon