我在 Articulate Storyline 3 中创建了一个项目。该项目的输出基本上是一个包含大量 javascript 的网页。一种是能够在项目中放置自定义 javascript 代码。当按下页面上的按钮时,我的自定义代码会导致浏览器进入全屏模式。这在 Chrome 和 Firefox 中运行良好,甚至在 IE11 中全屏显示。但是,当按下页面上的 Next 按钮转到项目中的下一张幻灯片时,IE11 会生成一个 javascript 错误。错误是 SCRIPT16389:函数不正确。这个错误似乎是一个通用的 IE javascript 错误,我不确定如何进一步解决这个问题。我输入的自定义 javacript 代码似乎不是导致错误的直接原因,但是按下 Next 按钮时会生成错误。下面是我附加到按钮的自定义代码,
function add_script(scriptURL,oID) {
var scriptEl = document.createElement("script");
var head=document.getElementsByTagName('head')[0];
scriptEl.type = "text/javascript";
scriptEl.src = scriptURL;
scriptEl.id=oID;
head.appendChild(scriptEl);}
//only want to add these once!
if(document.getElementById('jquery')==null){
add_script("https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js","jquery");
}
/* Get into full screen */
function GoInFullscreen(preso) {
if(preso.requestFullscreen)
preso.requestFullscreen();
else if(preso.mozRequestFullScreen)
preso.mozRequestFullScreen();
else if(preso.webkitRequestFullscreen)
preso.webkitRequestFullscreen();
else if(preso.msRequestFullscreen)
preso.msRequestFullscreen();
}
/* Get out of full screen */
function GoOutFullscreen() {
if(document.exitFullscreen)
document.exitFullscreen();
else if(document.mozCancelFullScreen)
document.mozCancelFullScreen();
else if(document.webkitExitFullscreen)
document.webkitExitFullscreen();
else if(document.msExitFullscreen)
document.msExitFullscreen();
}
/* Is currently in full screen or not */
function IsFullScreenCurrently() {
var full_screen_preso = document.fullscreenpreso || document.webkitFullscreenpreso || document.mozFullScreenpreso || document.msFullscreenpreso || null;
// If no preso is in full-screen
if(full_screen_preso === null)
return false;
else
return true;
}
GoInFullscreen($("#preso").get(0));
通过在 IE11 中打开此链接可以看到该问题,http: //andersonelearning.com/demo/FullScreen%201.1%20-%20Storyline%20output/story.html 。按蓝色的进入全屏按钮。IE11 应该进入全屏模式。然后按屏幕右下方的下一步按钮。预期的行为是文本幻灯片 2 应该出现在屏幕上,但会引发上述错误。