惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threat Research - Cisco Blogs
A
Arctic Wolf
S
Securelist
O
OpenAI News
T
Threatpost
Forbes - Security
Forbes - Security
N
News and Events Feed by Topic
S
Secure Thoughts
H
Heimdal Security Blog
S
Security Affairs
P
Privacy International News Feed
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
S
Security @ Cisco Blogs
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
T
Tailwind CSS Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hacker News: Ask HN
Hacker News: Ask HN
T
Troy Hunt's Blog
S
SegmentFault 最新的问题
腾讯CDC
V
Visual Studio Blog
Last Week in AI
Last Week in AI
H
Hacker News: Front Page
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Project Zero
Project Zero
WordPress大学
WordPress大学
NISL@THU
NISL@THU
博客园 - 【当耐特】
博客园 - Franky
Webroot Blog
Webroot Blog
博客园_首页
T
Tenable Blog
雷峰网
雷峰网
Google Online Security Blog
Google Online Security Blog
阮一峰的网络日志
阮一峰的网络日志
V2EX - 技术
V2EX - 技术
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
Lohrmann on Cybersecurity
The Hacker News
The Hacker News

博客园 - lzlynn

COMET彗星(四)COMET线程控制 Mule esb简介(觉得这篇文章不错,摘过来给大家看看。) COMET彗星(三)构建自己的COMET核心 COMET彗星(二)基于SERVER PUSH的消息传输 COMET彗星(一)SERVER PUSH介绍 Arcgis flex desktop (v0.1) 未完待续 SDE_GEODATABASE学习 初识ArcObjects 转载:北京好吃又便宜的地方 关于空间拓扑(lynn的自语) openlayers基类类图 flex介绍(摘自csdn) 对ie不支持getElementsByName的解决办法 测试计划(模板) openlayers加载gml(转载) EPML schema(附带用myeclipse生成的结构图) 转载 一个服务器启动多个tomcat BPM简介 AXIS
div不能放在applet上的解决方案(iframe)
lzlynn · 2008-10-06 · via 博客园 - lzlynn

    今天尝试着把worldwind放在底层,然后上面浮动div,结果发现applet的层级实在是太高了,网上的解决方案是用flash或者object。

     给大家看个iframe的解决办法,是国外的一个程序员做的http://www.oratransplant.nl/2007/10/26/using-iframe-shim-to-partly-cover-a-java-applet/

    效果是将sub div放在了一个applet时钟上,实际上是sub iframe。

HTML:

<!DOCTYPE html PUBLIC
   "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
  <body>
    <script type="text/javascript">
      function mouseIn() {
        // create an iframe at the exact same position and
        // size as the sub div
        // Google "iframe shime" for more information
        var shimmer = document.createElement('iframe');
        shimmer.id='shimmer';
        shimmer.style.position='absolute';
        // normally you would get the dimensions and
        // positions of the sub div dynamically. For demo
        // purposes this is hardcoded
        shimmer.style.width='150px';
        shimmer.style.height='80px';
        shimmer.style.top='100px';
        shimmer.style.left='80px';
        shimmer.style.zIndex='999';
        shimmer.setAttribute('frameborder','0');
        shimmer.setAttribute('src','javascript:false;');
        document.body.appendChild(shimmer);
        // make sub div visible
        var sd = document.getElementById('subdiv');
        sd.style.visibility='visible';
      }
      function mouseOut() {
        var sd = document.getElementById('subdiv');
        sd.style.visibility='hidden';
        var shimmer = document.getElementById('shimmer');
        document.body.removeChild(shimmer);
      }
    </script>
    <style type="text/css">
      #maindiv {display:block; width:150px; height:80px;
                background:red;}
      #subdiv  {display:block; width:150px; height:80px;
                background:blue; position:absolute;
                top:100px; left:80px;
                z-index:1000; visibility:hidden;}
    </style>
    <!-- top level div -->
    <div id="maindiv" onmouseover="mouseIn();"
                        onmouseout="mouseOut();">

      <p>MAIN DIV</p>
      <p>move mouse here</p>
    </div>
    <!-- subdiv that gets shown when mouse hovers
         over top level div -->

    <div id="subdiv">
      <p>SUB DIV</p>
    </div>
    <!-- java applet -->
    <applet style"border:1px solid blue;"
            codebase="http://java.sun.com/applets/jdk/1.4/demo/applets/Clock/"
            code="Clock.class" width="170" height="150">

    </applet>
  </body>
</html>

 后来又有个家伙做了一个导航菜单,个人觉得还是很值得看下的。

  1.     Ext.onReady(function(){  
  2.         var tb = Ext.getCmp('inventory');  
  3.         tb.on('menushow',function(toolbar,menu) {  
  4.             var menuEl = menu.getEl();  
  5.             createShim({  
  6.                 top:menuEl.getY(),  
  7.                 left:menuEl.getX(),  
  8.                 width:menuEl.getWidth(),  
  9.                 height:menuEl.getHeight()  
  10.             });  
  11.     });  
  12.         tb.on('menuhide',function(toolbar,menu) {  
  13.             var shimmer = document.getElementById('shimmer')  
  14.             document.body.removeChild(shimmer);  
  15.     });  
  16. });  
  17.     function createShim(coordinate) {  
  18.         var shimmer = document.createElement('iframe');  
  19.         shimmer.id='shimmer';  
  20.         shimmer.style.position='absolute';  
  21.         shimmer.style.top=coordinate.top;  
  22.         shimmer.style.left=coordinate.left;  
  23.         shimmer.style.width=coordinate.width;  
  24.         shimmer.style.height=coordinate.height;  
  25.         shimmer.style.zIndex='999';  
  26.         shimmer.setAttribute('frameborder','0');  
  27.         shimmer.setAttribute('src','javascript:false;');  
  28.         document.body.appendChild(shimmer);  
  29. }