Streaming live at 10am (PST)

Tab click to change body border


#1

Hello! My website (read-only link below) has a black border on the left that I would like to have change color depending on which tab is currently active. So far I’ve been trying to add a combo class to the body and use javascript to add/remove classes, but it doesn’t seem to work; I’m pretty new to coding so it could be a rookie mistake. Any help/ideas?

This is the script I was trying…

(function () { (’.indexTTCU’).click(function () {
$(’#Body’).addClass(’#borderRed’);
});
});

And here is my site Read-Only: https://preview.webflow.com/preview/juliekim?utm_source=juliekim&preview=3444a8fabf99bfba6f49063eb8991aaa

Thanks in advance!


#2

Hey Julie,

You’ll be able to achieve this effect using the Webflow’s interaction panel and without using custom code.

He a little demo I’ve built to show you how it works:
http://border-tab.webflow.io/

Cloneable link: https://webflow.com/website/Custom-Tab