简体   繁体   English

PHP,JavaScript弹出窗口,没有顶部栏

[英]PHP, JavaScript popup window without top bar

So I need to make pop-up window without top bar. 所以我需要使没有顶部栏的弹出窗口。 What I mean: 我的意思是:

When I click button (days of calender are buttons) I need that poped-up window like this: 当我单击按钮(压延的日子是按钮)时,我需要这样的弹出窗口: 弹出

I have script for now: 我现在有脚本:

<script type="text/javascript">
 <!--
  var stile = "top=10, left=10, width=600, height=800 status=no, menubar=no, toolbar=no scrollbar=no";
     function Popup(apri) {
        window.open(apri, "", stile);
     }
 //-->
</script>
<a href="javascript:Popup('YOURPAGE.html')">show popup</a>

After I click button It open this: 单击按钮后,将其打开:

弹出式视窗2

I need to make that opened not Firefox, but would be shown only grey content inside with "x" to close window: 我需要打开的不是Firefox,而是在其中仅显示灰色内容,并带有“ x”关闭窗口:

X

Thank you for answers. 谢谢你的回答。

You cannot. 你不能。 Browsers provide no mechanism to do so. 浏览器没有提供这样做的机制。

The closest you could come would be to use HTML and CSS (with JS to add draggable support and handle the close button) to create something that looks like a window, but is really part of the page (and thus cannot be dragged outside the window as it is not a window in its own right). 最接近的方法是使用HTML和CSS(使用JS添加可拖动的支持并处理关闭按钮)来创建看起来像窗口的东西,但实际上是页面的一部分(因此不能将其拖动到窗口之外)因为它本身并不是一个窗口)。

As mentioned by others, you can't create a popup that doesn't use the full browser window. 正如其他人所提到的,您不能创建不使用整个浏览器窗口的弹出窗口。

However, what you can do is create what is known as a 'popover'. 但是,您可以做的是创建所谓的“弹出框”。

That is, rather than use a new window, you use a combination of javascript, HTML and CSS to create something that behaves quite like a popup, but which is actually in the same browser window. 也就是说,不是使用新窗口,而是使用javascript,HTML和CSS的组合来创建行为类似于弹出窗口的内容,但实际上是在同一浏览器窗口中。

Think along the lines of how date pickers work on travel sites nowadays. 沿用如今的旅行网站上日期选择器的工作原理来思考。

One that works quite well is this jQuery plugin: https://github.com/klaas4/jQuery.popover 一个效果很好的是这个jQuery插件: https : //github.com/klaas4/jQuery.popover

It has a single page set of instructions in Demo.html that should get you started. 它在Demo.html中有一组说明页面,可以帮助您入门。

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM