Tabbed Phone Numbers

di-logo

Depending on the department (Sales, Service, Parts) we usually leave dealership information on the page. Instead of adding a different set of code to only show that specific department’s phone/hours, I wanted just one code block I could quickly add to each page, it would include all the departments, and then have it dynamically update the correct tab depending on the page. If the code block is on the Service page, then I want the service tab to be opened.

First, I had to build the dealer information box to include all the departments using tabs, then add JavaScript to verify the current page and update the corresponding tab to be the default one (the active tab). I had most of the JavaScript down, but totally got some help in the end. (that’s what senior dev’s are for!)

Tools: HTML, CSS, JavaScript.

Rosen Kia

Author: admin