collapse function added to nav elements

problem remains: navigation collapses and expands again right after