HTML 网页中怎么可以显示一个浮动窗口,而且始终在网页右边中间显示,点窗口上的按钮可以提交网页中的内容
- 提问者网友:雾里闻花香
- 2021-04-29 18:31
- 五星知识达人网友:渊鱼
- 2021-04-29 20:10
<div id="LeftDIV" style="position: absolute;left:20px; top: 150px; border-right: activeborder 1px solid;
border-top: activeborder 1px solid; border-left: activeborder 1px solid; border-bottom: activeborder 1px solid;">
<img src="../images/客服.gif" />
</div>
<div id="RightDIV" style="position: absolute;right:20px; top: 150px; border-right: activeborder 1px solid;
border-top: activeborder 1px solid; border-left: activeborder 1px solid; border-bottom: activeborder 1px solid;">
<img src="../images/客服.gif" />
</div>
<script type="text/javascript">
var leftStyle = document.getElementById("LeftDIV").style;
var rightStyle = document.getElementById("RightDIV").style;
window.onscroll = function() {
leftStyle.top = document.documentElement.scrollTop + 150 + "px";
rightStyle.top = document.documentElement.scrollTop + 150 + "px";
}
</script>
左右各一个,至于提交,你就在div里面扔button就行了