user1816133
user1816133

Reputation:

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: pop-up

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:

pop-up 2

I need to make that opened not Firefox, but would be shown only grey content inside with "x" to close window:

x

Thank you for answers.

Upvotes: 0

Views: 867

Answers (2)

Rob Baillie
Rob Baillie

Reputation: 3460

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.

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

It has a single page set of instructions in Demo.html that should get you started.

Good luck!

Upvotes: 0

Quentin
Quentin

Reputation: 943240

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).

Upvotes: 1

Related Questions