height=350 窗口高度
width=480 窗口宽度
scrollbars=no 不显示滚动条
resizable = no 不能调整大小
status = no 不显示状态栏
toolbar = no 不显示工具栏
menubar = no 不显示菜单栏
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许
<p class="shangqiao" style="text-align: center;margin-top:100px;">打开在线客服</p>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript">
function openWin(url)
{
var name; //网页名称,可为空;
var iWidth=500; //弹出窗口的宽度;
var iHeight=570; //弹出窗口的高度;
//window.screen.height获得屏幕的高,window.screen.width获得屏幕的宽
var iTop = (window.screen.height-30-iHeight)/2; //获得窗口的垂直位置;
var iLeft = (window.screen.width-10-iWidth)/2; //获得窗口的水平位置;
window.open(url,name,'height='+iHeight+',innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizable=no,location=no,status=no');
}
$(function() {
$('.shangqiao').click(function() {
openWin('./666.html');
});
});
</script>
转自:https://blog.csdn.net/solly793755670/article/details/79104211