我正在尝试更改第一步 (data-step="1"
) 的样式,我通过调用 onbeforechange()
introJs().onbeforechange(function(targetElement) {
switch (targetElement.getAttribute("data-step"))
{
case "1":
//change CSS styling only for the first box
$(".introjs-helperLayer .introjs-tooltip").attr("style", "margin-left: 10%");
break;
}
}).start();
基本上,我试图在第一步中将工具提示居中。任何帮助深表感谢;我是 JavaScript 的新手。
最佳答案
尝试使用这段代码:
introJs().onbeforechange(function(targetElement) {
switch (targetElement.getAttribute("data-step"))
{
case "1":
//change CSS styling only for the first box
$(".introjs-helperLayer").css("text-align", "center");
break;
}
}).start();
关于javascript - 使用 Intro.js 时如何针对特定步骤调整工具提示的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17414054/