Highlighter.js
720kb.github.io
720kb.github.io
By the way, I believe it uses the `outline` CSS property as opposed to `border` (border changes layout, outline doesn't).
The code is already open-source, feel free to open issues, fork and PR also if you want to add new features, the door is open wide!
.outlined:after { content: ""; position: absolute; top: 0; width: 0; height: 100%; width: 100%; background-color: green; opacity: 0.3; }
.outlined { position: relative; } // this part my be a poor assumption
Anyway appreciated a lot your example and your tips, let's just wait for some feedback from people who use it and make decisions more clear.
Thank you really :)
This is like a giant box wrapped in fancy wrappers but when you open the box there's not much substance inside, you spend more time dealing with the wrappers.
My bet is you are going to need more lines then this https://github.com/720kb/highlighter.js/blob/master/src/js/h... (which is going to be slimmed more)
Why do you need to do this? That's a solution looking for a problem.
Use cases are up to your imagination, just for example, think of a html5 game where you want to highlight but skip elements, or move cursor forward and backward... only a trivial example
To support older browsers you could use something like xpaths.js but safari, chrome, firefox all support document.evaluate() and manipulating the element is a no brainer just do addClass().
https://github.com/andrejpavlovic/xpathjs
Despite being a jQuery fan (I've used it to build 4k line jquery chrome extension) I find it much easier to just look up the javascript equivalent, more than often, it's worth knowing since it frees you from using library.
But keep at it, I think maybe if you could build something that does a very good job of highlighting dom elements on mouseover/mouseout with some intelligent highlighting (simply attaching event handlers to all elements on the dom page produces a jerky) I could see that being quite useful.
All in all, take my view with a grain of salt, just because I failed to see a use case and think it's more cost effective to know the DOM manipulations with javascript directly, does not mean that somebody out there might justify it's use.
Good stuff!
We did not find anything and we thought of writing it directly.
Obviously it's open source so anyone can use it and do and suggest changes, we are curious to see even the possible use cases that others have.
Probably using what you say would be the best is not easy to say so on the spot, it should be seen in any detail.
You could end up having various problems adding tabindex, many people use tabindex attribute.
I made a little JS bookmarklet a while ago that reveals script, style, and meta tags, and tries to display which tags are used to build the layout: http://www.youtube.com/watch?v=wp2d24t2POI
Are there any plans in the future to make your tool so the highlight follows that I tap on mobile? Keep up the great work!
This project was meant to easily surf the nodes and maybe highlight them, but it's still at early stage and any help is much appreciated!
Thanks for sharing the video, very interesting :)
Here you can check what's wrong and post new issues https://github.com/720kb/highlighter.js/issues
Any help is appreciated!
I"m sure the old JS programmers moved on to a real programming language, but they put you new guys to complete shame, and they didn't need 18 dependencies and a dependency manager to get it done.
jQuery was a great invention for web development, but everything since then has been total crap. Angular, React, Node, all of it's crap. The only people who like it are those who aren't smart enough to be real programmers.