Created
August 20, 2014 07:52
-
-
Save gunnarbittersmann/a633dfac9f6897ea5b35 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
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 characters
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| a | |
| { | |
| font: 1.5em/1 Georgia; | |
| display: inline-block; | |
| margin: 0 1em; | |
| } | |
| #boxes | |
| { | |
| list-style: none; | |
| margin: 4em 0 0 0; | |
| padding: 0; | |
| } | |
| #boxes li | |
| { | |
| display: inline-block; | |
| margin: 0 1em; | |
| width: 4em; | |
| height: 4em; | |
| background: #048; | |
| } | |
| .foo | |
| { | |
| background-color: orange; | |
| } |
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 characters
| <a id="foo" tabindex="0">foo</a> | |
| <a id="bar" tabindex="0">bar</a> | |
| <a id="foobar" tabindex="0">foo bar</a> | |
| <ul id="boxes"> | |
| <li class="foo"></li> | |
| <li class="bar"></li> | |
| <li class="foo bar"></li> | |
| </ul> |
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 characters
| var anchors = document.querySelectorAll('a'); | |
| var boxes = document.querySelector('boxes'); | |
| for (var i = 0, l = anchors.length; i < l; i++) | |
| { | |
| anchors[i].addEventListener('click', function () { boxes.className = 'foo' }, false); | |
| } |
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 characters
| {"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"javascript"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment