【发布时间】:2017-05-25 10:30:00
【问题描述】:
我的网站右下角有一个聊天框,打开和关闭都没有问题。默认情况下它是隐藏的,然后当您单击“聊天”时它会保持打开状态!我的问题是我希望聊天框在用户更改页面时保持打开状态,直到他们决定再次将其最小化。目前,如果您更改页面,聊天框会自动最小化。有人可以帮忙吗?
jQuery(document).ready(function() {
jQuery('#hideshow').on('click', function(event) {
jQuery('#initiallyHidden').toggle('show');
});
});
#chatbox {
position: fixed;
bottom: 0;
right: 0;
float: right;
}
#initiallyHidden {
bottom: 100;
right: 0;
float: right;
width: 300px;
height: 200px;
border-style: solid;
background-color: white;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="chatbox"><input type="button" id="hideshow" value="Quick Chat" class="tbox" />
<br>
<div id="initiallyHidden" style="display: none;">Content</div>
以上是所有用于此的脚本。
谢谢
【问题讨论】:
标签: jquery html toggle refresh