Last active
September 17, 2016 21:07
-
-
Save ryanve/8156e99239477b6fb268aad5c0ec42cb to your computer and use it in GitHub Desktop.
Compute and display an element's CSS properties
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
| $('[data-compute]').each(function() { | |
| $(this).text($(this.dataset.computeFrom).css(this.dataset.compute)); | |
| }); |
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
| <b id="example">example element</b> | |
| <ul> | |
| <li>color: <code data-compute="color" data-compute-from="#example"></code> | |
| <li>font-size: <code data-compute="font-size" data-compute-from="#example"></code> | |
| </ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment