Click to See Complete Forum and Search --> : Is there a way to hide title bar on pop-up window?


sdk_fan
07-10-2005, 06:59 PM
I want images to open from links on my website in a separate pop-up window. Is there a way to either hide the title bar or to change the title bar so it doesn't show the pages url when a separate window is opened? The code I'm using now is - with spaces removed - < a href="pic.jpg" onclick="window.open(this.href,'child','toolbar=no,height=768,width=1024,
resizable=yes,status=no'); return false" > < img src="pic.jpg" ></a > . The code works fine except when I open the new window I can see the url in the titlebar area. What am I doing wrong?
BTW, I don't want to use java script code at the beginning of my page in the event visitors have javascript disabled (I read the above way was best).

kender
07-11-2005, 12:02 AM
well, you can have the image page a html page with the image as the only line of code
<html>
<head>
<title> </title>
</head>
<body>
<img src="image.jpg" />
</body>
</html>

LeeU
07-11-2005, 08:16 AM
Try this:

< a href="pic.jpg" onclick="window.open(this.href,'child','titlebar=no,toolbar=no,height=768,width=1024,
resizable=yes,status=no'); return false" > < img src="pic.jpg" ></a >

bathurst_guy
07-11-2005, 08:19 AM
thats still javascript your using though so if they have it disabled then it wont work

sdk_fan
07-11-2005, 02:16 PM
well, you can have the image page a html page with the image as the only line of code
<html>
<head>
<title> </title>
</head>
<body>
<img src="image.jpg" />
</body>
</html>

Try this:

< a href="pic.jpg" onclick="window.open(this.href,'child','titlebar=no,toolbar=no,height=768,width=1024,
resizable=yes,status=no'); return false" > < img src="pic.jpg" ></a >

Okay, I tried the code but the url still shows up in the titlebar. It looks like my only option is to make a separate .html page for each image (which I was hoping to avoid). Thanks to both of you for your help.

sdk_fan
07-11-2005, 02:22 PM
thats still javascript your using though so if they have it disabled then it wont work
I understand it's still javascript but the site I got the code from said that if that code is used for each individual link, compared to one script for the whole page, then it will still work even if someone has javascript disabled. Guess the site is wrong (?). I'm still learning about javascript and how it works...one of the best ways to learn is by trial and error (and when I can't figure it out, get a little help from those in the know-how :) )

felgall
07-11-2005, 03:05 PM
What appears in the title bar depends on

1. What appears in the title of the page
2. The particular web browser being used
3. Settings within the browser.

It is not posdsible to remove the title bar or completely control what appears in it.

LeeU
07-11-2005, 04:11 PM
My mistake. I saw titlebar and thought toolbar.

It is, however, possible to change the title in the title bar:


<script type="text/javascript">
<!--
function changeTitle() {
var newTitle=prompt("Please enter a new title", "");
document.title=newTitle;
}
//-->
</script>



<a href="javascript:changeTitle()">Change title</a>

stymie
07-11-2005, 04:48 PM
If your are going to use javascript then just create one page and send your pics to it.
The page title will always be the same.

select.htm<html>
<head>
<title>Select_Pic</title>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
</head>
<body>
<a id="IMGtoSend" href="yourpic.jpg" onclick="window.open('display.htm','child','width=500,height=300'); return false;">yourpic_name</a>
</body>
</html>

display.htm<html>
<head>
<title>Display_Pic</title>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<script type="text/javascript">
function getIt()
{ var newPic = parent.window.opener.document.getElementById("IMGtoSend").href;
document.getElementById("myImg").src = newPic;
}
onload= function(){getIt();}
</script>
</head>
<body>
<img id="myImg">
</body>
</html>

sdk_fan
07-12-2005, 03:09 PM
Okay, here's another question: if I'm already using a script on my page (I'm using javascript so link urls don't appear on the windows status line) can I also use another script (such as one of the above) on the same page without one script messing up the other? Or can I combine the two scripts? (I really appreciate all the help everyone is giving me)

This is the script I'm currently using:
<script>

function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
</script>

WoD
07-12-2005, 04:42 PM
Two script blocks will co-exist peacefully in one HTML page in most cases- providing you don't have duplicate function/variable names.