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

标签 jquery flash

是否可以从 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/

相关文章:

flash - 如果您运行的 Flash 应用程序使用了 Flash Player 不支持的类、方法或属性,将会发生什么情况?

jQuery offset() 没有按预期工作

javascript - JS - 获取点击标签的数据属性以在其他页面上使用

javascript - 选择自定义属性时无法识别的表达式

javascript - 第二个 Javascript 表单 POST 在 Chrome 中失败,在 IE 和 FF 中有效

javascript - SWFUpload 未初始化

javascript - keyup 函数自动计算结果

javascript - 使用 jquery 通过方法选择 javascript 对象

c# - 翻译我写到 C# 的 ActionScript 3 代码

flash - 基于Flash的音频分配器控制