add js code to nav buttons