Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
45kb committed Jul 9, 2015
1 parent 27f2edc commit f7e60d6
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 73 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ bower install highlighter.js

###Usage
```
var Highlighter = new window.Highlighter();
document.addEventListener("DOMContentLoaded", function(event) {
Highlighter.next('<div>');
Highlighter.underline();
var Highlighter = new Highlighter();
Highlighter.next('<div>');
Highlighter.underline();
window.console.log('Highlighter underlined this element:', Highlighter.element);
window.console.log('Highlighter underlined this element:', Highlighter.element);
});
```
###Demo ...

Expand Down Expand Up @@ -138,7 +141,17 @@ var Highlighter = new window.Highlighter({
});
```

####Scroll to the underlined element
Sometime you could need to scroll to the current underlined element, so, to automatically scroll to it once is underlined you can set the options ```{scroll:true, scrollDuration: 500 }```
```
var Highlighter = new window.Highlighter({
'scroll':true, //Automatically scroll to the underlined element
'scrollDuration': 500 //milliseconds
});
```

##Gtk
- Not yet 100% ready for production
- Scroller is a bit horrible atm
- If no selectable next elements, Highlighter will restart from the first element in DOM
- If no selectable previous elements, Highlighter will restart from the first element in DOM
4 changes: 2 additions & 2 deletions dist/highlighter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f7e60d6

Please sign in to comment.