1

我尝试在小程序上制作一个 div,并在 MAC 上的 firefox、chrome 和 safari 中正常工作。但不是在 Windows 上

我究竟做错了什么?我搜索了“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>
4

1 回答 1

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>

于 2013-05-14T11:59:31.593 回答