这是我的第一个问题!我正在使用Google幻灯片模板,该模板用于今年(2011)的Google IO演示文稿。
http://code.google.com/p/io-2011-slides/
我想做的是在每张幻灯片的基础上运行Javascript。这是另一个SlideShow库中的代码,我想使用Google IO模板重新创建它:
//You can trigger Javascript based on the slide number like this:
$('html').bind('slide', function(e, id) {
switch(id) {
case 2:
console.log('This is the second slide.');;
break;
case 3:
console.log('Hello, third slide.');
break;
}
});有没有人能建议用Google IO slide框架做一些类似的事情?非常感谢!
发布于 2011-05-13 02:56:48
在幻灯片定义中,您可以包含代码。
<article onslideenter="console.log('This is the second slide.');">
...发布于 2011-05-13 03:05:35
查看slides code,我注意到它发出事件slideenter和slideleave。因此,本姆的解决方案应该是有效的。您也可以执行article.addEventListener('slideenter', function(){...}, false)或(IE的.attachEvent)
https://stackoverflow.com/questions/5982851
复制相似问题