1

我使用opentip并尝试使用自定义样式设置 opentip 样式。

这些是我在咖啡里的代码。

Opentip.styles.orangetip = { 
  stem: true,
  borderColor: "#ffa358",
  borderWidth: "50",
  background: "#ffa358",
  fixed: true,
  stemLength: "10"
  }

我什至使用这个块将我的样式设置为默认值,但它仍然不起作用。

Opentip.defaultStyle = "orangetip"

这是我调用样式的脚本。

tip1 = new Opentip("#testong", "Optional content", { 
  style: "orangetip", 
  showOn: "mouseover"
})

样式未加载,但 showOn 正在运行。例如,如果我将“鼠标悬停”更改为“单击”,则容器将通过单击而不是悬停显示。

任何人都知道为什么样式不加载?谢谢你。

4

1 回答 1

4

我已经找到了答案。

问题是因为我使用“”作为整数值。

所以,它必须是:

Opentip.styles.orangetip = { 
  stem: true,
  borderColor: "#ffa358",
  borderWidth: 50,
  background: "#ffa358",
  fixed: true,
  stemLength: 10
}
于 2013-12-07T17:18:36.640 回答