2012-04-10 93 views
1

我知道我必須設置wmode屬性,但我在哪裏設置屬性的柔性紙。Flexpaper重疊的HTML元素

以下是將Flexpaper嵌入到HTML文檔中的代碼。

<script type="text/javascript"> 
        var doc     = '<?php print $doc; ?>'; 
        var numPages   = <?php echo getTotalPages($pdfFilePath . $doc) ?>; 
        var swfFileUrl   = escape('{services/view.php?doc='+doc+'&page=[*,0],'+numPages+'}'); 
        var searchServiceUrl = escape('services/containstext.php?doc='+doc+'&page=[page]&searchterm=[searchterm]'); 

        var fp = new FlexPaperViewer( 
          'FlexPaperViewer', 
          'viewerPlaceHolder', { config : { 
          SwfFile : swfFileUrl, 
          Scale : 1, 
          ZoomTransition : 'easeOut', 
          ZoomTime : 0.5, 
          ZoomInterval : 0.2, 
          FitPageOnLoad : false, 
          FitWidthOnLoad : false, 
          FullScreenAsMaxWindow : false, 
          ProgressiveLoading : false, 
          MinZoomSize : 0.2, 
          MaxZoomSize : 5, 
          SearchMatchAll : true, 
          SearchServiceUrl : searchServiceUrl, 
          InitViewMode : 'Portrait', 
          BitmapBasedRendering : false, 

          ViewModeToolsVisible : true, 
          ZoomToolsVisible : true, 
          NavToolsVisible : true, 
          CursorToolsVisible : true, 
          SearchToolsVisible : true, 

          localeChain: 'en_US' 
          }});   
       </script> 

回答

1

我沒有看到通過傳遞一個參數到FlexPaperViewer構造函數來做到這一點的方法,但是您可以在flexpaper_flash.js中解決它。近線19,嘗試增加wmode PARAM有:

window.FlexPaperViewer = window.$f = function() { 
    var config = arguments[2].config; 

    window.FlexPaperViewer_Instance = flashembed(arguments[1], { 
     //add wmode here 
     wmode: "transparent", 
     src: arguments[0]+".swf", 
     version: [10, 0], 
     expressInstall: "js/expressinstall.swf" 
    },{ 
     ... 
    }); 
}; 
0

wmode實際上是您在HTML中爲SWF嵌入代碼設置的配置參數。要回答更具體你需要證明你是如何嵌入代碼,並且將wmode值FlexPaper要求。但是,這裏有幾種基於常用嵌入方法的方法。

,如果您使用嵌入的SWF動畫的HTML樣式添加這下到現有的param標籤。

<param name="wmode" value="transparent"> 

另外,如果你使用SWFObject嵌入您的SWF可以設置的wmode像這樣:

var flashvars = {}, 
params = {wmode:"transparent"}, 
attributes = {}; 

swfobject.embedSWF("/swf/yourSWF.swf", "anim", "300", "200", "9.0.0", "/swf/expressInstall.swf", flashvars, params, attributes); 

欲瞭解更多信息,請參閱該wmode parameter中的Adobe文檔。

+0

請參閱更新後的文章 – SupaOden 2012-04-17 14:12:25

1

一個更好的想法是隻需添加以下到您的flexpaper配置:

像這樣:

var fp = new FlexPaperViewer(
          '<%:FlexPaperViewer %>', 
          'documentViewer', { config: { 

            SwfFile: '<%:SwfFile%>.swf', 
            IMGFiles: '<%:SwfFile%>_{page}.png', 
            JSONFile: '/GetJson.ashx?q=<%=SwfFile%>.json', 

            ...lots of other irrelevant params... 
            WMode : 'transparent', 

            localeChain: 'en_US' 
           } 
          }); 

Flexpaper將拾波將其放在Flash對象上(我正在使用flexpaper 1.5(2012年5月))