Results 1 to 6 of 6

Thread: Open window without navigation bars

  1. #1
    Join Date
    Dec 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Open window without navigation bars

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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    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.
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  4. #4
    Join Date
    Dec 2009
    Location
    Richmond, Virginia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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...thout-lightbox - really COOL, tiny and great

    http://www.smashingmagazine.com/2009...rn-web-design/
    an article explaining where and when to use Modal Boxes
    Hope this helps

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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
    Lightwindow
    Lightbox 2.04a
    JQuery Lightbox 0.5

    And many, many others. Google:

    Lightbox Clones

    and:

    Javascript Modal

    for more.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Techsol, if you want to open foreign 'popups', you can do something like this:
    Code:
    <!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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •