Sorry for my unclear expression. Yes, "switch to another tab" means clicking the circles part1 , part2 and part3. Thank you guys @GreenSock for the crisp reply , I just solve the question. But I think my code is lengthy. is there any way to improve this code? https://codepen.io/UHU/pen/GbJYza Much appreciated!