gpt4 book ai didi

JQuery(可能是 SWFObject)在 IE 7.0.5730.13 或 8.0.6001.18702 或 8.0.7100.0 中没有执行应有的操作,但在 7.0.5730.11 中工作

转载 作者:行者123 更新时间:2023-12-01 06:09:28 25 4
gpt4 key购买 nike

我有一个网站,上面运行着 jQuery 和 SWFObject。页面加载时,它会设置 2 秒超时,然后触发 SWFObject 实例加载影片。当电影结束时,玩家会回调 JS 来触发另一部电影。另一部电影加载良好并播放。播放完毕后,第二部电影也应该触发另一个回调,但事实并非如此。我认为问题在于,在第二个电影初始化时,它应该清除前一个元素并重置它,以便 SWFObject 可以重用它,即使这是 DOM 中发生的情况,SWFObject 也不会重用该元素。我认为这是因为 jQuery 仍然以某种方式保留了该元素,即使它已从 DOM 中删除,这会在 SWFObject 尝试重用它时抛出 IE。

我附上了我的代码,所以也许有人能够发现它不起作用的地方,或者是否有人对如何让 jQuery 从 DOM 和 jQuery 对象中清除元素有建议。

代码可能看起来有点杂乱,但这是我第一次在 Stack Overflow 上发布,所以我不知道如何让它发布所有格式正确的代码......

提前致谢!

var Shadow;
var ActorWrapper, VideoWrapper;
var Actor, Video;
var Navigation;
var Flash, Random;
var t;

$(document).ready(function () {
if (jQuery.browser.msie && jQuery.browser.version <= 6) {
$(".Body").supersleight();
};

t = window.setTimeout(function () {
window.clearTimeout(t);

Flash = $("#Flash");

if (Boolean(Flash.val())) {
Shadow = $("#Shadow");
ActorWrapper = $("#ActorWrapper");
Actor = $("#Actor");
VideoWrapper = $("#VideoWrapper");
Video = $("#Video");
Random = $("#Random");
Navigation = $(".Navigation");

VideoWrapper.css({
left: parseInt(($(document).width() - 400) / 2),
top: parseInt(($(window).height() - 300) / 2)
});

IncomingActor();
};
}, 2000);
});

var IncomingActor = function () {
ActorWrapper.css({
display: "block",
height: 325,
left: parseInt((($(window).width() - 714) / 2) - 46),
width: 180
});

swfobject.embedSWF("/Resources/Flash/Player.swf", "Actor", "180", "325", "9", null, {
Path: "Amy-1.flv",
Callback: "Vid",
Buffer: 2,
Width: 180,
Height: 325
}, {
play: true,
loop: false,
quality: "best",
wmode: "transparent",
swliveconnect: true,
allowscriptaccess: "always"
});

Navigation.css({
textAlign: "right"
});
};

var Vid = function () {
$("#Actor").remove();
$("#ActorWrapper").html("<div id=\"Actor\"></div>");

VideoWrapper.css({
display: "block"
});

Shadow.css({
display: "block",
height: $(document).height(),
width: $(document).width()
}).animate({
opacity: 0.6
}, 1000).click(function () {
VideoWrapper.animate({
opacity: 0
}, 500);

t = window.setTimeout(function () {
window.clearTimeout(t);

VideoWrapper.css({
display: "none"
});

Shadow.animate({
opacity: 0
}, 500);

t = window.setTimeout(function () {
window.clearTimeout(t);

Shadow.css({
display: "none"
});
}, 500);
}, 500);
});

swfobject.embedSWF("/Resources/Flash/Player.swf", "Video", "400", "300", "9", null, {
Path: (Random.val() + ".flv"),
Callback: "OutgoingActor",
Buffer: 2,
Width: 400,
Height: 300
}, {
play: true,
loop: false,
quality: "best",
wmode: "transparent",
swliveconnect: true,
allowscriptaccess: "always"
});

VideoWrapper.animate({
opacity: 1
});

Navigation.css({
textAlign: "center"
});
};

var OutgoingActor = function () {
ActorWrapper.css({
left: (parseInt(ActorWrapper.css("left")) + 10)
});

VideoWrapper.animate({
opacity: 0
}, 500);

t = window.setTimeout(function () {
window.clearTimeout(t);

VideoWrapper.css({
display: "none"
});

Shadow.animate({
opacity: 0
}, 500);

t = window.setTimeout(function () {
window.clearTimeout(t);

Shadow.css({
display: "none"
});
}, 500);
}, 500);

swfobject.embedSWF("/Resources/Flash/Player.swf", "Actor", "180", "325", "9", null, {
Path: "Amy-2.flv",
Callback: "RemoveOutgoingActor",
Buffer: 2,
Width: 180,
Height: 325
}, {
play: true,
loop: false,
quality: "best",
wmode: "transparent",
swliveconnect: true,
allowscriptaccess: "always"
});

Navigation.css({
textAlign: "right"
});
};

最佳答案

仅使用通过 xml 文件指定的播放列表不是更好吗?

关于JQuery(可能是 SWFObject)在 IE 7.0.5730.13 或 8.0.6001.18702 或 8.0.7100.0 中没有执行应有的操作,但在 7.0.5730.11 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1246437/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com