0

我正在定制一个很棒的插件,允许轻松声明 HTML5 视频的提示点。(它被称为 cuepoint.js)

它带有声明的变量;一旦这些变量被触发/它在屏幕上以标题的形式显示文本。这很好;但我想弄清楚如何在已经编写的代码中调用图像。

我试过挤压 agetElementbyID和标准 HTMLimg标记,并得到 a#div但它没有呈现。使用相同代码和调用图像的任何指针;与文字相反。

$(document).ready(function(){
//Slides object with a time (integer) and a html string
var slides = {
0: "I would like to display an Image here, though",
2: "This is 2 Seconds.",
3: "This is 3 Seconds.",
6: "This is what 6 Seconds looks like.",
10: "This is 10 Seconds.",
}
4

1 回答 1

2

如果您希望 HTML 显示为幻灯片,只需将该 HTML 添加为字符串。

var slides = {
  0: "<img src='http://example.com/image.jpg' />",
  2: "This is 2 Seconds.",
  3: "This is 3 Seconds.",
  6: "This is what 6 Seconds looks like.",
  10: "This is 10 Seconds."
}
于 2013-01-14T21:08:59.267 回答