//CSS
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
transition: 0.4s;
}
.active, .accordion:hover {
background-color: #ccc;
}
.panel {
padding: 0 18px;
display: none;
background-color: white;
overflow: hidden;
}
//JS
function openAccordion(i)
{
var panel = document.getElementById('panel-'+i);
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
}
function openNextAccordion(i)
{
var panel = document.getElementById('panel-'+i);
panel.style.display = "none";
var panel_new = document.getElementById('panel-'+(i+1));
panel_new.style.display = "block";
}
Search Knowledge Base Articles
Wordpress - Accordion CSS & JS
Did you find this article useful?
Related Articles
-
Dynamic Base URL for Codeigniter Projects
$protocol = stripos($_SERVER['SERVER_PROTOCOL'],'https') === true ? 'https://' : 'http://';$root = $... -
How to Stop Chrome from Automatically Redirecting to https
https://howchoo.com/chrome/stop-chrome-from-automatically-redirecting-https... -
STOP LOADING A WEBPAGE IF JAVASCRIPT DISABLED
STOP LOADING A WEBPAGE IF JAVASCRIPT DISABLED All the webpages, works with supporting files such as ... -
SMS API
$authkey = 'key';$sender_id = 'senderid';$DLT_TE_ID = dltid;$country_code = '0';$message_content = '... -
Youtube Thumbnail image
Youtube video thumbnails are available in four different qualities and dimensions.SD 640 x 480https:...