小编Pra*_*dar的帖子

将intro.js工具提示强制到右侧并使页面滚动

当您在intro.js中添加一个大工具提示时,它会通过执行以下操作来计算是否有空间将工具提示放在顶部,底部,左侧,右侧:

/*
* auto determine position 
*/

// Check for space below
if (targetElementRect.bottom + tooltipHeight + tooltipHeight > windowSize.height) {
  _removeEntry(possiblePositions, "bottom");
}

// Check for space above
if (targetElementRect.top - tooltipHeight < 0) {
  _removeEntry(possiblePositions, "top");
}

// Check for space to the right
if (targetElementRect.right + tooltipWidth > windowSize.width) {
  _removeEntry(possiblePositions, "right");
}

// Check for space to the left
if (targetElementRect.left - tooltipWidth < 0) {
  _removeEntry(possiblePositions, "left");
}
Run Code Online (Sandbox Code Playgroud)

然后它决定将工具提示浮动在元素的顶部 在此输入图像描述

有没有办法可以强制它让工具提示在元素下面并使页面可滚动?(动态改变页面高度)(即使在实际的原始主体已经结束之后)

javascript intro.js

6
推荐指数
1
解决办法
169
查看次数

标签 统计

intro.js ×1

javascript ×1