2012-10-06 27 views
1

我試圖做一個小程序小程序,並在MAC上的Firefox,鉻和Safari瀏覽器正常工作。但不是在Windows上Div小程序

我在做什麼錯?我搜索了「div over applet」並找到了iframe的解決方案,但它不起作用。

這裏是我的代碼:

   <div class="humans"> 

        <div class="humans-box"> 

        <!-- here is my applet --> 

         <applet allowtransparency="true" id="applet" code="main.AvatarClient.class" archive="AvatarClient_411.jar" 
         name="Chat" width="760" height="582" scriptable="true" MAYSCRIPT="true" style="background:transparent;position:absolute"> 
          <param name="cache_option" value="NO"> 
          <param name="wmode" value="transparent"> 
          <param name="localization" value="locDK/"></param> 
          <param name='userName' value='<?=$user?>' /> 
          <param name='password' value='<?=$pass?>' /> 
         </applet> 
        </div> 
       </div> 
       <div style="width:760px;"> 

     <!-- make the hack!--> 

     <iframe class="top" id="DivShim"src="javascript:false;"scrolling="no"frameborder="0"style="position:absolute;top:0px;z-index:45455;left:0px;display:none"></iframe> 

     <!--div to place over applet --> 

     <div class="top" style="z-index:45456;position:absolute"> 
      <ul class="menu"> 
       <li><a href="javascript:nagoom.view('onlineusers')"><?=Language::___get('ONLINE_USERS', $_SESSION['lang'])?></a> 
       </li> 
       <li><a href="#"><?=Language::___get('TOP_USERS', $_SESSION['lang'])?></a> 
       </li> 
       <li><a href="#"><?=Language::___get('SEARCH_USERS', $_SESSION['lang'])?></a> 
       </li> 
      </ul> 
      <div class="user-menu"> <a href="#" class="btn-restart"><span><?=Language::___get('GENSTART', $_SESSION['lang'])?></span></a>  <a href="#" class="btn"><?=Language::___get('BEGYNDER_GUIDE', $_SESSION['lang'])?></a> 
       <a 
       href="#" class="f-btn"><span>&nbsp;</span>Connect og få 100 mønter</a> 
      </div> 
     </div> 
+0

你提到的一些瀏覽器,但什麼是「窗口」瀏覽器的名稱。它是Internet Explorer瀏覽器還是不適用於Windows操作系統。這很荒謬 – polin

+0

它在Windows上的Internet Explorer和Google Chrome(最新版本)上。在MAC上工作。 –

回答

1

使用jQuery顯示一個彈出式對話框,並使用div來控制小程序可見或不可見。這裏是我的代碼示例,你可以作爲你的參考。它適用於IE,FF,Chrome和Opera。

<html lang="en"> 
<head> 
    <meta charset="utf-8" /> 
    <title>jQuery UI Dialog Over Java Applet</title> 
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> 
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script> 
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
    <script> 
    function showDialog(result) 
    { 
     document.getElementById("btn_show").disabled = true; 
     var upm = document.getElementById("javaapplet"); 
     upm.style.visibility='hidden'; 
     if(result == 0){ 
      $("#press-complete").dialog({ 
       modal: true, 
       height:280, 
       width:350, 
       resizable: false, 
       buttons: { 
       Ok: function() { 
        $(this).dialog("close"); 
        upm.style.visibility='visible'; 
        document.getElementById("btn_show").disabled = false; 
       } 
       } 
      }); 
     } 
    } 
    </script> 
</head> 

<body> 
    <!-- complete --> 
    <div id="press-complete" title="Complete" style="display:none;"> 
     <p><span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span> 
      Upload <b>Complete</b>.</p> 
     <p>You could view <b>text area</b> for the <b>detail</b>.</p> 
     <p>Please reboot the system to take effect.</p> 
    </div> 
    <p>Here is a example to show dialog over Java Applet.&nbsp;<input id="btn_show" type="button" value="show Dialog" onclick="showDialog(0)" /></p> 
    <div id="javaapplet" style="display:inline"> 
     <applet width=300 height=300 code="DrawingWithColor2" codebase="http://www.javakode.com/applets/03-color/"> 
      <param name="cache_option" value="no"> 
      This page require Java enviornment! Please install Java first. 
     </applet> 
    </div> 
</body>