PROJET AUTOBLOG


Shaarli - Les discussions de Shaarli

Archivé

Site original : Shaarli - Les discussions de Shaarli du 23/07/2013

⇐ retour index

Search Keyword Highlighting < JavaScript | The Art of Web

samedi 12 septembre 2015 à 19:37
KraZhtest - Liens utiles - C'est le bordel
Recherche instantanée, en gros équivalent à un bon vieux CTRL + F, mais bon 5% des gens s'en servent. Ca fait le coup à chaque fois hihihi.
Démo: http://www.the-art-of-web.com/search-highlight-demo.html

{code
<div id="container">
<form>
Search: <input id="keywords" placeholder="start typing"></p>
</form>
<script src="http://www.the-art-of-web.com/hilitor.js"></script>;
<!-- Host your scripts! -->
<script>
 var myHilitor;
 document.addEventListener("DOMContentLoaded", function() {
   myHilitor = new Hilitor2("container");
   myHilitor.setMatchType("left");
 }, false);

 document.getElementById("keywords").addEventListener("keyup", function() {
   myHilitor.apply(this.value);
 }, false);
</script>
code}