1.0.17 • Published 2 years ago

js-smart-hint v1.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Smart Hint.

Simple, lightweight pure JavaScript component that implement customizable re-positioning hint.

Demo

https://jagermesh.github.io/js-smart-hint/

Usage:

1) Include the script:

<script type="text/javascript" src="smart-hint.js"></script>

2) Create SmartHint instance

const hint = new SmartHint();

3) Attach where needed

hint.attach('.has-hint');

4) Customize if needed

hint.attach('.has-custom-hint', {
  getContent: function(selector) {
    return new Promise(function(resolve) {
      resolve('Hint Text');
    });
  },
  beautify: function(hintOverlay, selector) {
    hintOverlay.style.fontSize = `${Math.floor(Math.random() * 10)+8}pt`;
    hintOverlay.style.backgroundColor = 'red';
    hintOverlay.style.color = 'white';
  }
});

That's all.

Have fun. Send PR if you find any glitches or want to make improvements.

:)

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago