mir3z / texthighlighter

-- NO LONGER MAINTAINED -- TextHighlighter allows you to highlight text on web pages.
http://mir3z.github.com/texthighlighter/
MIT License
230 stars 101 forks source link

Is there a way to enable/disable ? #10

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi, Is there a way to toggle hilighting events? to make a button On/Off (or select/deselect a color) the behavior. Thanks

mir3z commented 9 years ago

Currently the only way is to use destroy() method, but later you will have to create a new highlighter to re-enabled highlighting. I wil add enabling/disabling functionality in a spare time.

nickam992 commented 9 years ago

Hey mir3z, any update on making an On/Off button? Also, how do you call the destroy method correctly? I'm able to call it, but the event listener doesn't actually get removed.
Here's how I'm creating the highlighter: this.highlighter = new TextHighlighter( $("#container")[0] );

And here's how I'm attempting to destroy it: this.highlighter.destroy();