Last active
August 29, 2015 14:14
-
-
Save oak-tree/d300e882a54b9de428b2 to your computer and use it in GitHub Desktop.
mark all border in page
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
| //add javascript line into your bookmark and click on a page | |
| //known bug: if jquery is not loaded this will only work on the 2nd click | |
| javascript: (function() { if (!window.jQuery) { var script = document.createElement('script'); script.src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"; | |
| document.body.appendChild(script); } if (window.markAllElementsBackground) { $('*').each(function() { $(this).css('background-color',$(this).data('save-background-color-data')) }); window.markAllElementsBackground = false; } else { $('*').each(function() { $(this).data('save-background-color-data', $(this).css('background-color')); var color = "#" + Math.floor(Math.random() * 0xFFFFFF).toString(16);$(this).css('background-color', color )}); window.markAllElementsBackground = true ; }})(); | |
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
| //add javascript line into your bookmark and click on a page | |
| //known bug: if jquery is not loaded this will only work on the 2nd click | |
| javascript: (function() { if (!window.jQuery) { var script = document.createElement('script'); script.src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"; | |
| document.body.appendChild(script); } if (window.markAllElements) { $('*').each(function() { $(this).css('border',$(this).data('save-border-data')) }); window.markAllElements = false; } else { $('*').each(function() { $(this).data('save-border-data', $(this).css('border')); var color = "#" + Math.floor(Math.random() * 0xFFFFFF).toString(16);$(this).css('border','1px solid ' + color )}); window.markAllElements = true ; }})(); | |
Author
Author
an example of the result:
in one click you get
https://www.dropbox.com/s/ohzr4nvavupmgb8/mark%20elements%20on%20page.PNG?dl=0
and in 2nd click you can return to regular state
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
using border can effects the elements because it added pixel to the border. it easy to replace the code to use background color instead of border