summaryrefslogtreecommitdiff
path: root/JS/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'JS/main.js')
-rw-r--r--JS/main.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/JS/main.js b/JS/main.js
index ec46e4c..e541d5f 100644
--- a/JS/main.js
+++ b/JS/main.js
@@ -1,9 +1,9 @@
function searchDuck(event){
var x = document.getElementById('Search').value;
- if (event.keyCode == 13 || event.which == 13) {
+ if (event.keyCode == 13 || event.which == 13) {
if (x == '/4chan'){
fourChan()
- }
+ }
else if (x == '/help'){
help()
}
@@ -11,4 +11,19 @@ function searchDuck(event){
}
function FocusOnInput(){
document.getElementById("Search").focus();
-} \ No newline at end of file
+}
+function dropdown(theID) {
+ document.getElementById(theID).classList.toggle("show");
+}
+window.onclick = function(event) { //when the user clicks anywhere else on the screen the menu disappears
+ if (!event.target.matches('.dropbtn')) {
+ var dropdowns = document.getElementsByClassName("dropdown-content");
+ var i;
+ for (i = 0; i < dropdowns.length; i++) {
+ var openDropdown = dropdowns[i];
+ if (openDropdown.classList.contains('show')) {
+ openDropdown.classList.remove('show');
+ }
+ }
+ }
+}