IntroJs 提示 当父元素不可见时,如何跳过或隐藏?出于某种原因,似乎只有内联对我的提示起作用。我在 HTML 的跨度中有数据提示,我需要检查最近的元素是否可见或父/子元素。
var hints = false;
var all = document.getElementsByTagName("*");
功能介绍功能(){
for (var i = 0, max = all.length; i < max; i++) {
if ((isHidden(all[i]) && hints));
document.getElementById("#helpFunc").html("Show Help");
introJs().hideHints();
} else {
document.getElementById("#helpFunc").html("Hide Help");
introJs().showHints();
}
hints = !hints;
function isHidden(el) {
var style = window.getComputedStyle(el);
return ((style.display === 'none') || (style.visibility === 'hidden'));
}
}