我想实现粘性弹出窗口,单击粘在屏幕左侧的图标即可打开该弹出窗口,其位置将固定在屏幕上。 下面添加了 pop 的示例图像。
这将是asp.net中的一个控件,我想使用jquery来实现它。
我搜索了可用于实现此粘性弹出窗口的插件,但没有得到我想要的。
因此,如果有人知道它的任何插件或任何示例代码,请分享。
最佳答案
您不需要插件来实现它。此类场景的示例如下。
$(function() {
$("#MyButton").click(function() {
$("#Contents").toggle();
});
});
#MyButton {
width: 100px;
height: 50px;
position: fixed;
top: 20px;
right: 20px;
background-color: lightgray;
}
#Contents {
position: fixed;
top: 10px;
left: 10px;
bottom: 10px;
right: 120px;
background-color: lightgray;
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="MyButton">Click Here</div>
<div id="Contents">
Contents
</div>
关于jquery - 粘性弹出窗口实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48201024/