-1

每次我想通过单击按钮时,我想在 html 页面上显示一个窗口(面板)。但我不希望它影响页面。例如,我不希望它改变页面大小并使页面滚动。实际上,我想在 Google 地图上显示一个面板并在此面板上添加一些输入框,但我无法在地图上显示任何内容。这张照片正是我想要的。

4

2 回答 2

0

给你一个简单的例子。见小提琴http://jsfiddle.net/6XCjb/

<html>
<head>
   <style>
      .panel { 
         background: #ccc; 
         padding: 20px; 
         position: absolute;
         top: 30px;
         left: 30px;
         width: 100px;
         height: 100px;
         z-index: 1000;
      }
   </style>
</head>
<body>
  <div class="panel">
    This is panel
  </div>
  <div class="map">
    <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ru/maps?hl=ru&amp;ie=UTF8&amp;ll=55.795502,49.073303&amp;spn=0.709453,2.113495&amp;t=m&amp;z=10&amp;output=embed"></iframe><br /><small><a href="https://maps.google.ru/maps?hl=ru&amp;ie=UTF8&amp;ll=55.795502,49.073303&amp;spn=0.709453,2.113495&amp;t=m&amp;z=10&amp;source=embed" style="color:#0000FF;text-align:left">Просмотреть увеличенную карту</a></small>
  </div>
</body>
</html>
于 2013-10-01T07:26:00.593 回答
0

使面板position: fixed或这种方式的position: absolute<body面板将覆盖当前内容而不会导致页面大小增加。

于 2013-10-01T06:01:54.430 回答