Javascript 当滚动到页面底部时,如何使按钮保持在页脚上方
我有一个“反馈”按钮。应始终在屏幕的左下侧显示 除非你即将到达页脚,它应该保持在顶部 当您继续查看页脚时,不要继续向下滑动 以下是我的HTML标记:Javascript 当滚动到页面底部时,如何使按钮保持在页脚上方,javascript,css,twitter-bootstrap,Javascript,Css,Twitter Bootstrap,我有一个“反馈”按钮。应始终在屏幕的左下侧显示 除非你即将到达页脚,它应该保持在顶部 当您继续查看页脚时,不要继续向下滑动 以下是我的HTML标记: <div class="TMDOQ-tab navbar-fixed-bottom"> <a href="#" id="TMDOQ_button"> <img src= "assets/TMDOQ.png" alt= "Logo-DitoMismo" class="hidden-ph
<div class="TMDOQ-tab navbar-fixed-bottom">
<a href="#" id="TMDOQ_button">
<img src= "assets/TMDOQ.png" alt= "Logo-DitoMismo" class="hidden-phone" id="logoTMDOQ">
</a>
<div class="TMDOQ-form">
<fieldset>
<div class="control-group">
<label class="control-label">First name:</label>
<div class="controls">
<input type="text" placeholder="Type something…">
</div>
</div>
<div class="control-group">
<label class="control-label">Email Address:</label>
<div class="controls">
<input type="text" placeholder="Type something…">
</div>
</div>
<div class="control-group">
<label class="control-label">Cellphone Number:</label>
<div class="controls">
<input type="text" placeholder="Type something…">
</div>
</div>
<div class="control-group">
<label class="control-label">Item Name:</label>
<div class="controls">
<input type="text" placeholder="Type something…">
</div>
</div>
<div class="control-group">
<button type="submit" class="btn-primary">Submit</button>
</div>
</fieldset>
</div>
</div>
当我使用JS时:
$("#TMDOQ_button").click(function()
{
$('.TMDOQ-form').slideToggle();
});
我认为这是我正在尝试做的最接近的事情,尽管他们正在使用jQuery,我不知道如何在我的代码中实现它,但是我不需要一个完整的边栏,我只需要将反馈按钮粘贴在屏幕的左下角,当接近页脚区域时,它将停止在上面
使用底层固定位置
.TMDOQ-tab navbar-fixed-bottom
{
position: fixed;
}
使用固定在底层类中的位置
.TMDOQ-tab navbar-fixed-bottom
{
position: fixed;
}
.TMDOQ选项卡导航栏固定底部{
位置:固定;底部:0;左侧:0
}
.TMDOQ选项卡导航栏固定底部{
位置:固定;底部:0;左侧:0
}
使用中固定在按钮上的位置css@Hushme:我尝试添加位置:固定;但每当我到达页面底部时,当它到达页脚的开头时,它不会停止。然后使用这个插件滚动固定搜索google@Hushme再次感谢你。我将研究这个插件,比如$.lockfixed(#sidebar.menu“,{offset:{top:10,bottom:620});使用中固定在按钮上的位置css@Hushme:我尝试添加位置:固定;但每当我到达页面底部时,当它到达页脚的开头时,它不会停止。然后使用这个插件滚动固定搜索google@Hushme再次感谢你。我将研究这个插件,比如$.lockfixed(#sidebar.menu“,{offset:{top:10,bottom:620});