Skip to content

Commit 1e26e23

Browse files
committed
Possibility Toggle Language Prog
Programming language specific toggle example on the OOP file. - Does not include: Listener to remember the selected after page refresh Javascript has to be changed to its own specific file rather than on the .md itself.
1 parent ce9497f commit 1e26e23

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

docs/Concepts/OOP.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,27 @@ has_children: false
1111

1212
{% include under_construction.html %}
1313

14+
<div id="cppContent">
15+
<!-- Your default C++ content goes here -->
16+
This is C++ content for Object-Oriented Programming.
17+
</div>
1418

15-
<br>
19+
<div id="csharpContent" style="display:none;">
20+
<!-- Your C# content goes here -->
21+
This is C# content for Object-Oriented Programming.
22+
</div>
1623

17-
<br>
24+
<button onclick="showContent('cpp')">C++</button>
25+
<button onclick="showContent('csharp')">C#</button>
26+
27+
<script>
28+
function showContent(language) {
29+
if (language === 'cpp') {
30+
document.getElementById('cppContent').style.display = 'block';
31+
document.getElementById('csharpContent').style.display = 'none';
32+
} else if (language === 'csharp') {
33+
document.getElementById('cppContent').style.display = 'none';
34+
document.getElementById('csharpContent').style.display = 'block';
35+
}
36+
}
37+
</script>

0 commit comments

Comments
 (0)