如何为 jQuery 元素指定页面上的固定位置?换句话说,jQuery 元素的绝对定位

发布于 2024-10-09 18:43:44 字数 840 浏览 0 评论 0原文

<script type="text/javascript">
$(function() {

 $('a.StackedSystem').hover(function(e) {
  var html = '<div id="StackedSysteminfo">';
  html +=    '<div id="StackedSystemTxt">

    ETTER utilizes the latest technologies for our booster systems, including PLC-Based controls complete with touch-screen panel user interfaces (HMI). The base package includes the gray scale screen as shown; color screens are also available. The PLC not only provides a cleaner interface but provides additional features like automatic logging and time/date stamping of all alarms and shut-downs. 
    Great for trouble-shooting.</div>';

  html +=  '</div>';    
  $('body').append(html).children('#info').hide().fadeIn(400);
 }, function() {
  $('#StackedSysteminfo').remove();
 });
});
</script>
<script type="text/javascript">
$(function() {

 $('a.StackedSystem').hover(function(e) {
  var html = '<div id="StackedSysteminfo">';
  html +=    '<div id="StackedSystemTxt">

    ETTER utilizes the latest technologies for our booster systems, including PLC-Based controls complete with touch-screen panel user interfaces (HMI). The base package includes the gray scale screen as shown; color screens are also available. The PLC not only provides a cleaner interface but provides additional features like automatic logging and time/date stamping of all alarms and shut-downs. 
    Great for trouble-shooting.</div>';

  html +=  '</div>';    
  $('body').append(html).children('#info').hide().fadeIn(400);
 }, function() {
  $('#StackedSysteminfo').remove();
 });
});
</script>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ζ澈沫 2024-10-16 18:43:44

查看 jQuery UI Position,并详细说明您的问题。哪些元素?

Take a look at jQuery UI Position, and elaborate on your question. Which element(s)?

蓝眼泪 2024-10-16 18:43:44
$('element').css({"position":"absolute","top":15,"left":10 });

在此示例中,您将元素放置在距页面顶部 15 px 和距页面左侧 10 px 的位置。

编辑

然后您可以将上面的absolute更改为relative并确保包装器是绝对或相对定位的。

$('element').css({"position":"absolute","top":15,"left":10 });

In this example you would be positioning the element 15 px from the top of the page and 10px from the left of the page.

EDIT

Then you could change absolute above to relative and make sure the wrapper is absolutely or relatively positioned.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文