Last active
February 11, 2020 17:58
-
-
Save brittanydionigi/a74c66b0cf1b20bf4102341a4f0fd212 to your computer and use it in GitHub Desktop.
Revisions
-
brittanydionigi revised this gist
Aug 27, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ <html> <head> <style type="text/css"> #main { padding: 100px; border: 2px solid pink; } .blue { background-color: blue; } </style> </head> <body> -
brittanydionigi revised this gist
Aug 27, 2019 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,9 @@ <div id="main">Lorem ipsum dolor!</div> <script type="text/javascript"> function $(selector) { let selectorType = selector.split('').shift(); // grab the # or . from the selector let selectorName = selector.substr(1); // grab the ID or class name from the selector let DOMElement = selectDOMElement(); // select the DOM element function selectDOMElement() { if (selectorType === '#') { -
brittanydionigi revised this gist
Jul 9, 2019 . 1 changed file with 27 additions and 27 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,38 +8,38 @@ <body> <div id="main">Lorem ipsum dolor!</div> <script type="text/javascript"> function $(selector) { let selectorType = selector.split('').shift(); let selectorName = selector.substr(1); let DOMElement = selectDOMElement(); function selectDOMElement() { if (selectorType === '#') { return document.getElementById(selectorName); } else { return document.querySelectorAll(selectorName); } } return { addClass(className) { DOMElement.classList.add(className); }, removeClass(className) { DOMElement.classList.remove(className); }, hasClass(className) { return DOMElement.classList.contains(className); }, toggleClass(className) { if (this.hasClass(className)) { this.removeClass(className); } else { this.addClass(className); } } } }; </script> </body> </html> -
brittanydionigi revised this gist
Jul 9, 2019 . 1 changed file with 34 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,39 @@ </head> <body> <div id="main">Lorem ipsum dolor!</div> <script type="text/javascript"> function $(selector) { let selectorType = selector.split('').shift(); let selectorName = selector.substr(1); let DOMElement = selectDOMElement(); function selectDOMElement() { if (selectorType === '#') { return document.getElementById(selectorName); } else { return document.querySelectorAll(selectorName); } } return { addClass(className) { DOMElement.classList.add(className); }, removeClass(className) { DOMElement.classList.remove(className); }, hasClass(className) { return DOMElement.classList.contains(className); }, toggleClass(className) { if (this.hasClass(className)) { this.removeClass(className); } else { this.addClass(className); } } } }; </script> </body> </html> -
brittanydionigi revised this gist
Jul 9, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,6 @@ </head> <body> <div id="main">Lorem ipsum dolor!</div> <script src="https://gist.githubusercontent.com/brittanystoroz/c2bb16b0ceb16e5d397b099ab454daea/raw/c88e5178872620dd78398b138fa0c29e8dbc2088/myjQuery.js"></script> </body> </html> -
brittanydionigi revised this gist
Jul 9, 2019 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,5 @@ <html> <head> <style type="text/css"> #main { padding: 100px; background-color: pink; } .blue { background-color: blue !important; } -
brittanydionigi created this gist
Jul 9, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ <html> <head> <style type="text/css"> #main { padding: 100px; background-color: pink; } .blue { background-color: blue !important; } </style> </head> <body> <div id="main">Lorem ipsum dolor!</div> <script type="text/javascript" src="https://gist.githubusercontent.com/brittanystoroz/c2bb16b0ceb16e5d397b099ab454daea/raw/c88e5178872620dd78398b138fa0c29e8dbc2088/myjQuery.js"></script> </body> </html>