2012-04-01 80 views
3

我正在使用带3D图形的Flash制作FB画布应用程序。我必须用param wmode =“direct”嵌入我的SWF。Facebook上的Flash隐藏功能无法在IE上工作

根据FB documentation,当使用wmode =“direct”时,FB在显示弹出窗口/对话框(购买信用卡,聊天,通知等)时隐藏闪存对象,并在弹出关闭后再次显示闪存。

在Chrome和Firefox上它可以正常工作,但在IE,对话框关闭后,我检查了闪存元素样式,并且我看到该可见性=可见,但闪光仍然隐藏!

我试了几种方法,都用相同的结果:

  1. 不使用 “hideFlashCallback” 上FB.init(FB让做,它会自动 )
  2. 使用 “hideFlashCallback”:

    function onFlashHide(params) { 
        if (params.state == 'opened') { 
        hideFlash(); 
        FB.Canvas.hideFlashElement(params.elem); 
        } else if (params.state == 'closed') { 
        showFlash(); 
        FB.Canvas.showFlashElement(params.elem); 
        } 
    } 
    function hideFlash() { 
        $('#flashContent').css('visibility', 'hidden'); 
    } 
    function showFlash() { 
        $('#flashContent').css('visibility', 'visible'); 
    } 
    

谢谢!
Roei

UPDATE:
另一个参考FB文档:http://developers.facebook.com/docs/appsonfacebook/tutorial/#flash

回答

0

您是否尝试过使用display: none;display:block代替visibility: hiddenvisibility: visible?在过去的项目中,我注意到,IE浏览器有时会遇到visibility CSS属性的问题...

+0

我试过了,它没有工作。更重要的是,它在Chrome中也不起作用。感谢您的帖子:) – Roei 2012-05-09 07:27:44

1

我在调用FB.ui函数时遇到了与IE相同的问题。 Facebook对话框将打开,但关闭Flash后不会回来。

我找到了解决这个问题的技巧。在调用FB函数之前,使用javascript将焦点设置为不同的HTML元素。之后,当我完成Facebook对话框时,Flash对象再次变为可见。

// IE9 has a problem where the Flash object won't regain 
// focus if it has focus when the FB UI is called. To fix this, 
// We'll redirect focus before the call. 
var lFocus = document.getElementById('focus_target'); 
lFocus.focus(); 

希望这有助于。