I’m sure I’m missing something stupid here but I cannot see it.
What is supposed to happen is that, with a vertical list, when a LI is clicked it animates right 10px, if another LI is clicked then it moves back and the clicked LI moves right.
This works fine going down the list but if I go back to a previous LI the previous selected one moves back as it should but the clicked LI doesn’t animate, so when you click back and forth the LI’s keep going further back
$("#navig li").click(function(){
$("#navig li.selected").animate({
left: "-=10px",
}, 300 );
$("#navig li.selected").removeClass("selected")
$(this).addClass("selected")
$(this).animate({
right: "-=10px",
}, 300 );
})
If you adjust
lefteither plus or minus, do the opposite for other condition but do it to same position propertyleft.