Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 24th, 2004, 01:02 AM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Removing title bar - is this possible?

I would like to remove the top menu bar from a child window that I use and was wondering if this is possible? I realize I would need to provide a "close" button as the window would no longer have the resize or close window elements available.

The following is the code I use to open the child window:

<a class="yellowcyan" a href="#" onClick="window.open('review.htm','Max','toolbar=n o,width=750,height=475,left=115,top=145,screenX=50 0,screenY=200,status=no,scrollbars=yes,resize=yes' );return false">guestbook</a>



__________________
Rudy
Reply With Quote
  #2 (permalink)  
Old January 24th, 2004, 03:37 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

There is an attribute that does it but Internet Explorer doesn't support it, and in Gecko browsers its use requires a signed script.

The attribute is:

titlebar (yes|no)

More information on signed scripts:
http://www.mozilla.org/projects/secu...d-scripts.html

Disabling the title bar can create possible security/privacy concerns.. if you couldn't close the popup.. then all the ad popups would use it, right? Even though you may have a completely harmless use in mind and be prepared to include code that closes the window. The fact remains that it could be misused. And I would suppose it isn't available in Internet Explorer because the window object is completely integrated into what the operating system is... from a Microsoft standpoint that means that all windows/dialogs have titlebars and to disable it you would have to take a more complex approach, like Java or C, or whatever and even with that approach you would have to get the user's permission to install the necessary program on their machine. You can sort of create the illusion of a popup window using CSS layers and Javascript, but there are a few fallbacks, the layer cannot leave the window, the layer may not render certain elements as you would expect, namely input elements.. I've never done it myself but if you make the layer movable with an onmousedown event handler, there may be issues with the browser being able to redraw the input elements. Don't know if there is any truth to that. But its an option worth considering.

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #3 (permalink)  
Old January 24th, 2004, 12:25 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

larry,

You can use the "fullscreen" property, but that isn't much of a popup.

However, let me elaborate on what Rich was saying: it is possible to make an imitation popup with a movable DIV. I have done it and would show you but I'm kinda short on time right now. You may want to have 2 separate DIVs, one for titlebar and one for content. Assign borders to make is look like it's elevated. Then use the onmousedown and onmouseup on the titlebar to call a function that says something like "document.onmousemove = movediv;". movediv() would set top and left of the titlebar DIV to the mouse coordinates, and the content to the titlebar DIV's bottom property. Be sure to add a "hide" button...

HTH

Snib

Reply With Quote
  #4 (permalink)  
Old January 24th, 2004, 10:01 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Interesting approach - would be interesting in seeing the code at your convenience.

Thanks for the reply
Larry

------------------------------

Quote:
quote:Originally posted by Snib
 larry,

You can use the "fullscreen" property, but that isn't much of a popup.

However, let me elaborate on what Rich was saying: it is possible to make an imitation popup with a movable DIV. I have done it and would show you but I'm kinda short on time right now. You may want to have 2 separate DIVs, one for titlebar and one for content. Assign borders to make is look like it's elevated. Then use the onmousedown and onmouseup on the titlebar to call a function that says something like "document.onmousemove = movediv;". movediv() would set top and left of the titlebar DIV to the mouse coordinates, and the content to the titlebar DIV's bottom property. Be sure to add a "hide" button...

HTH

Snib

Reply With Quote
  #5 (permalink)  
Old January 26th, 2004, 03:07 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

For the fullscreen or the DIV? I assume DIV, but just in case...

Fullscreen:

window.open("whatever.htm","thename","fullscreen") ;

DIV:

Step 1 - make two DIVs, one formatted to be your titlebar(short and wide, perhaps) and one formatted to have content(must contain a DIV with an iframe). Perhaps use CSS to style after assigning IDs to them (for my example: "titlebar" and "contentbox" for the DIVs, "contentpage" for the iframe). Make sure they are hidden before they are called upon.

Step 2 - assign onmousedown and onmouseup to "titlebar": onmousedown="init_drag()" onmouseup="done_drag()"

So far the DIVs should look like this:

<div id="titlebar" onmousedown="init_drag()" onmouseup="done_drag()">THE TITLE</div>
<div id="contentbox"><iframe src="" id="contentpage"></iframe></div>

Step 3 - write functions:
function init_drag()
{
     document.onmousemove = setpos;
}
function done_drag()
{
     document.onmousemove = "";
     document.getElementById("contentbox").style.visibi lity = "hidden";
     document.getElementById("titlebar").style.visibili ty = "hidden";
}
function setpos()
{
     var titbar = document.getElementById("titlebar");
     var content = document.getElementById("contentbox");
     titbar.style.top = event.y - 5;
     titbar.style.left = event.x - 5;
     content.style.top = titbar.style.bottom;
     content.style.left = event.x - 5;
}
function show_pop(url)
{
     document.getElementById("titlebar").style.visibili ty = "visible";
     document.getElementById("contentbox").style.visibi lity = "visible";
     document.getElementById("contentpage").src = url;
}


Step 3 - the link: <a href="#" onclick="show_pop('your_page.htm')">LINK</a>


Remember to add the hide button (which would link to a function that hides the DIVs)!!! Also remember the restrictions of it (cannot leave the page, etc.). Yet another thing: when the user drags the 'window' off the page, over a Flash movie, or just moves it too fast, it can mess up, maybe stick to the mouse so that you can't close it.

Hope this helps you,

Snib

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
create custom vb form title bar cindy Pro VB 6 1 September 22nd, 2005 02:57 PM
url appears in title bar when refreshing shibp2pkumar Classic ASP Basics 3 May 4th, 2005 07:48 PM
How do disable Menu bar & address bar for browser bekim HTML Code Clinic 2 January 7th, 2005 12:33 AM
How to trap Mouse events on Title bar/Caption bar chiefouko Pro VB.NET 2002/2003 0 September 21st, 2004 02:42 AM
Dynamically write to title bar. fs22 Javascript How-To 2 June 2nd, 2004 04:16 PM



All times are GMT -4. The time now is 06:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.