【问题标题】:keep suggestion box div relative to input when zooming缩放时保持建议框 div 相对于输入
【发布时间】:2013-04-11 15:04:10
【问题描述】:

我在表格中有这个表格,其中一个文本输入有一个建议框。当页面缩小到 90% 时,建议框 div 会向下和向右移动大约 6 个像素。缩放时有什么方法可以使 div 保持在相同的位置?谢谢。这是jsfiddle to demonstate

html:

table {
        border:1px solid grey;
      }

#box {
       border:1px solid red; 
       width:150px; 
       position:absolute; 
       top:35px; 
       left:41px; 
       background-color:white;
     }

<table>
  <tr>
    <td>one</td>
    <td><input></td>
  </tr><tr>
    <td>two</td>
    <td><input type = "button" id = "showBox" value = "click then zoom out"></td>
  </tr>
</table>

<div id = "box" style = "display:none;">
  <ul>
    <li>now zoom out</li>
  </ul>
</div>

javascript:

$('#showBox').click(function(){
   $('#box').show();
});

【问题讨论】:

    标签: javascript jquery html css


    【解决方案1】:

    我已经更新了你的fiddle

    移动了对应&lt;td&gt;中的框。虽然还是有一些闪烁,但比以前好多了。希望它符合你的标准:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-12
      • 1970-01-01
      • 1970-01-01
      • 2013-05-13
      • 2014-08-19
      • 2021-10-11
      相关资源
      最近更新 更多