gpt4 book ai didi

jquery - 是否可以从 Flash 电影中打开 JQuery 灯箱?

转载 作者:行者123 更新时间:2023-12-01 08:29:05 25 4
gpt4 key购买 nike

是否可以从 Flash 影片中打开 JQuery 灯箱?

最佳答案

尝试Calling any JS lightbox from Flash using jQuery

闪光:

import flash.external.ExternalInterface;
button.addEventListener(MouseEvent.CLICK, external, false, 0, true);
function external(evt:MouseEvent):void {
ExternalInterface.call("external", "lightbox/photos/image1.jpg");
}

Javascript:

function external(path) { // pass in the correct path to the function so we only need one <A> for infinite amount of calls from  flash              
// if the lightbox does not exist we will make it
if ($('a#lightbox').length == 0) {
$("body").append("</A><A id="lightbox" style="visibility: hidden; position: absolute; left: -9999px;" href="http://www.thetruetribe.com/+path+">calling js lightbox from flash</A>");
$('a#lightbox').lightBox();
// if it already exists but the path is different we will set the new path
} else if ($('a#lightbox').attr("href") != path) {
$('a#lightbox').attr("href", path);
}
// now we will simulate the click here.
$('a#lightbox').trigger("click");
}

或者你可以移植 flashLightBoxInjector Start Lightbox from Flash如果您对编写 javascript 有一定的信心,则可以轻松将 PrototypeJS 类添加到 jQuery 框架

关于jquery - 是否可以从 Flash 电影中打开 JQuery 灯箱?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1006302/

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