deepsite-project / script.js
enzinol's picture
Look at the attached image
3060a8b verified
Raw History Blame Contribute Delete
1.18 kB
```javascript
document.addEventListener('DOMContentLoaded', function() {
// Handle tab switching
document.querySelectorAll('.nav-link').forEach(tab => {
tab.addEventListener('click', function(e) {
e.preventDefault();
document.querySelectorAll('.nav-link').forEach(t => t.classList.remove('active'));
this.classList.add('active');
// Here you would load the sections for the selected tab
});
});
// Handle section selection
document.querySelectorAll('.list-group-item').forEach(item => {
item.addEventListener('click', function() {
document.querySelectorAll('.list-group-item').forEach(i => i.classList.remove('active'));
this.classList.add('active');
// Here you would load the notes for the selected section
});
});
// Simulate loading notes when clicking sections
document.querySelectorAll('.list-group-item').forEach(section => {
section.addEventListener('click', function() {
const editorFrame = document.querySelector('iframe');
editorFrame.src = 'editor.html';
});
});
});
```