如何为 jQuery 元素指定页面上的固定位置?换句话说,jQuery 元素的绝对定位
<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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 jQuery UI Position,并详细说明您的问题。哪些元素?
Take a look at jQuery UI Position, and elaborate on your question. Which element(s)?
在此示例中,您将元素放置在距页面顶部 15 px 和距页面左侧 10 px 的位置。
编辑
然后您可以将上面的
absolute
更改为relative
并确保包装器是绝对或相对定位的。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 torelative
and make sure the wrapper is absolutely or relatively positioned.