usablica / intro.js

Lightweight, user-friendly onboarding tour library
http://introjs.com
Other
22.8k stars 2.59k forks source link

refresh() does not call _placeTooltip #249

Closed qbolec closed 5 years ago

qbolec commented 10 years ago

If the highlighted element moves and resizes, calling refresh() moves and resizes the highlight overlay, but does not adjust the tooltip in a correct way

qbolec commented 10 years ago

One way to resolve it is to simplify the way in which the introjs-tooltip is positioned. For example in case of position:left instead of tooltipLayer.style.right = (_getOffset(targetElement).width + 20) + 'px'; one could use right:100% and margin-right:6px, so that whenever the helperLayer is resized, the tooltip will be automatically repositioned (thanks to 100% expression).

qbolec commented 10 years ago

https://github.com/qbolec/intro.js/commit/c7462a9407c6f1e681198fa9e222647c6ebe2020 - this resolved the issue for me and somewhat simplified your code