Log in

View Full Version : Open window without navigation bars



techsol
12-26-2009, 04:37 PM
Is there any script available that will initiate a popup window of a designated size when a link is clicked and also hide the navigation bar? Thanks...

jscheuer1
12-26-2009, 05:33 PM
Yes, and mostly no. At one time that was pretty easy to do. Now it's a security violation on all modern browsers that open new windows. Most deal with this by forcing the display of the address bar, though in local testing they will still allow the address bar to be absent. Others will show the address or at least the domain somehow. I believe this can be overcome if your code, site and/or page uses an up to date certificate.

vwphillips
12-26-2009, 08:24 PM
It is all according what you mean by a popup window

A div with the required content can be made to popup at a specified position.

If this is what you require say and code of links to scripts can be provided

The more detail you specify on the popup the better.

IanPatrickBuss
12-26-2009, 09:26 PM
Although I do not have a script to take away the navigation bar, I have an alternative option:

I think you should consider adding a modal box to perform the same action as the pop up... Just google Modal Box
http://jqueryui.com/demos/dialog/ - requires jQuery (no biggy really)
Most browsers these days have pop up blockers and most users HATE pop ups... Modal boxes are much cooler and easier to implement...
http://okonet.ru/projects/modalbox/ - small
http://orangoo.com/labs/GreyBox/ - large!
http://www.pjhyett.com/posts/190-the-lightbox-effect-without-lightbox - really COOL, tiny and great

http://www.smashingmagazine.com/2009/05/27/modal-windows-in-modern-web-design/
an article explaining where and when to use Modal Boxes
Hope this helps

jscheuer1
12-27-2009, 03:40 AM
Yes, vwphillips and IanPatrickBuss. I had meant to mention that approach. There really are so many of these type scripts. Fortunately many are interchangeable (as far as the markup used in the body of the page goes), and those that are not can be fairly quickly adapted one to the other. The crucial thing is to find the one that best suits your needs. Of those requiring a third party library, if your site already uses one of these libraries, that would tend to weigh in favor of one that uses that same library. There are other considerations though. The feature set is also important. As there are so many, choose one that already does what you need, rather than trying to adapt one to those needs.

In addition to those already mentioned, there are also:

Lytebox (http://www.dolem.com/lytebox/)
Lightwindow (http://www.stickmanlabs.com/lightwindow/)
Lightbox 2.04a (http://www.dynamicdrive.com/forums/showthread.php?p=163470#post163470)
JQuery Lightbox 0.5 (http://leandrovieira.com/projects/jquery/lightbox/)

And many, many others. Google:

Lightbox Clones (http://www.google.com/search?hl=en&client=opera&rls=en&q=Lightbox+Clones&btnG=Search&aq=f&oq=&aqi=)

and:

Javascript Modal (http://www.google.com/search?hl=en&client=opera&rls=en&hs=1Jw&q=Javascript+Modal&btnG=Search&aq=f&oq=&aqi=)

for more.

molendijk
12-27-2009, 05:26 PM
Techsol, if you want to open foreign 'popups', you can do something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title>Pop</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<script type="text/javascript">
function create_external(the_id,url,objifr_style)
{
var inserted=document.getElementById(the_id);
if(/*@cc_on!@*/false)
{
inserted.innerHTML='<iframe src="' + url + '", style="'+ objifr_style +'"><\/iframe>'
}
else
{while (inserted.firstChild)
{
inserted.removeChild(inserted.firstChild);
}
OBJ = document.createElement("object");
OBJ.setAttribute('type','text/html');
OBJ.setAttribute('data',url);
OBJ.setAttribute('style',objifr_style);
inserted.appendChild(OBJ);
}
}
</script>

<script type="text/javascript">
function hide(tag,className) {
var els = document.getElementsByTagName(tag)
for (i=0;i<els.length; i++) {
if (els.item(i).className == className){
els.item(i).style.display="none";
while (els.item(i).firstChild)
els.item(i).removeChild(els.item(i).firstChild);
}
}
}

function showPop( whichPop )
{
var elem, vis;
elem = document.getElementById( whichPop );
vis = elem.style;
vis.display='block';
}
</script>

</head>

<body >
<div>

<button onclick="hide('div','inserted')">Hide all</button><br>

<a href="javascript:void(0)" onclick= "showPop('pop1');create_external('pop1', 'http://www.google.com', 'position:relative; width:190px; height:250px; left:0px; border:1px solid red; margin-top:9px'); return false;">google</a>&nbsp;&nbsp;
<div id="pop1" class="inserted" style="display:inline"></div>

<a href="javascript:void(0)" onclick= "showPop('pop2');create_external('pop2', 'http://www.dynamicdrive.com', 'position:absolute; width:200px;height:250px; left:10%; border:1px solid red; top:20%'); return false">dynamicdrive</a> &nbsp;&nbsp;
<div id="pop2" class="inserted"></div>

</div>

</body>

</html>
===
Arie Molendijk