diff --git a/docs/assets/styles.css b/docs/assets/styles.css index 5e4afff..0826106 100644 --- a/docs/assets/styles.css +++ b/docs/assets/styles.css @@ -3,7 +3,7 @@ } body { - font-family: 'Roboto'; + font-family: 'Roboto' sans-serif; font-size: 16px; } diff --git a/docs/index.html b/docs/index.html index 983ae04..4e394a3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,6 +15,16 @@ + + + +
diff --git a/src/tooltip.js b/src/tooltip.js index d0fb787..0497034 100755 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -23,7 +23,7 @@ window.tooltipComponentInitiated = true; } - let $body = document.querySelector('body'); + let $body; let $tooltip; let $currentEle; let options = {}; @@ -31,7 +31,13 @@ let exitDelayTimeout; let hideDurationTimeout; - addEvents(); + window.addEventListener('load', initTooltip); + + function initTooltip() { + $body = document.querySelector('body'); + + addEvents(); + } /** event methods - start */ function addEvents() { diff --git a/webpack.config.js b/webpack.config.js index 901e72b..c9cb76b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const FileManagerPlugin = require('filemanager-webpack-plugin'); -const banner = `Tooltip v1.0.5 +const banner = `Tooltip v1.0.6 https://sa-si-dev.github.io/tooltip Licensed under MIT (https://github.com/sa-si-dev/tooltip/blob/master/LICENSE)`;