Skip to content

Commit

Permalink
dropdowns!
Browse files Browse the repository at this point in the history
  • Loading branch information
CherrelleTucker committed Dec 30, 2024
1 parent 7601435 commit db9a2cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 46 deletions.
25 changes: 4 additions & 21 deletions _tabs/Assessment.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,27 +425,10 @@ order: 3
</div>

<script>
/* JavaScript for card toggling */
/**
* Toggles the expanded/collapsed state of a card
* @param {HTMLElement} header - The header element that was clicked
*/
function toggleCard(header) {
// Toggle active class on header
header.classList.toggle('active');

// Toggle active class on content section
const content = header.nextElementSibling;
content.classList.toggle('active');

// Close other open cards
const allHeaders = document.querySelectorAll('.card-header');
allHeaders.forEach(otherHeader => {
if (otherHeader !== header && otherHeader.classList.contains('active')) {
otherHeader.classList.remove('active');
otherHeader.nextElementSibling.classList.remove('active');
}
});
function toggleCard(button) {
button.classList.toggle('active');
const content = button.nextElementSibling;
content.classList.toggle('show');
}
</script>

Expand Down
25 changes: 0 additions & 25 deletions _tabs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1398,31 +1398,6 @@ function toggleCard(button) {
content.classList.toggle('show');
}

/**
* Toggles the expanded/collapsed state of a card
* @param {HTMLElement} header - The header element that was clicked
function toggleCard(header) {
// Toggle active class on header
header.classList.toggle('active');
// Toggle active class on content section
const content = header.nextElementSibling;
content.classList.toggle('show');
// Close other open cards
const allHeaders = document.querySelectorAll('.solution-header.active, .card-header.active');
allHeaders.forEach(otherHeader => {
if (otherHeader !== header && otherHeader.classList.contains('active')) {
otherHeader.classList.remove('active');
const otherContent = otherHeader.nextElementSibling;
if (otherContent) {
otherContent.classList.remove('active');
}
}
});
}*/

// Optional: Add keyboard navigation
document.addEventListener('keydown', function(event) {
if (event.key === 'Escape') {
Expand Down

0 comments on commit db9a2cb

Please sign in to comment.