Frameless Popup window with no title bar, automatic closes once it leaves the window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ismailc
    New Member
    • Sep 2006
    • 200

    Frameless Popup window with no title bar, automatic closes once it leaves the window

    Hi,

    I want to execute a javascript in my xslt file.
    that does the following!

    this script launches a popup
    window without the Windows frame or titlebar
    (that is, a "containerl ess" window). In other
    browsers, it launches a standard popup window.
    Position, width, and height are settable.
    Automatic closing of the window on leaving the
    page may also be optionally set.

    I seached on google but the code does not work in the xslt file.

    Anyone please assist!

    Regards,
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Post the code that you're working with.

    Comment

    • ismailc
      New Member
      • Sep 2006
      • 200

      #3
      Hi, This the entire xslt file with the script (framework) that i want,
      Thank You for the assistance.

      Code:
      <HEAD>
        <SCRIPT TYPE='text/javascript'>
                  <!-- Original:  CodeLifter.com (support@codelifter.com) -->
                  <!-- Web Site:  http://www.codelifter.com -->
      
                  <!-- This script and many more are available free online at -->
                  <!-- The JavaScript Source!! http://javascript.internet.com -->
      
      
                  var windowW=214 // wide
                  var windowH=398 // high
                  var windowX = 260 // from left
                  var windowY = 100 // from top
                  var urlPop = "http://srv08-za119/fcParmalatTest/browse2.aspx?o=739.html"
                  var title =  "This Is A Frameless Popup Window"
      
                  var autoclose = true
      
                  s = "width="+windowW+",height="+windowH;
                  var beIE = document.all?true:false
                  function openFrameless() {
                  if (beIE) {
                  NFW = window.open("","popFrameless","fullscreen,"+s);
                  NFW.blur();
                  window.focus();
                  NFW.resizeTo(windowW,windowH);
                  NFW.moveTo(windowX,windowY);
                  var frameString=""+
                  "<html>"+
                  "<head>"+
                  "<title>"+title+"</title>"+
                  "</head>"+
                  "<frameset rows='*,0' framespacing='0' border='0' frameborder='0'>"+
                  "<frame name='top' src='"+urlPop+"' scrolling='auto'></frame>"+
                  "<frame name='bottom' src='about:blank' scrolling='no'></frame>"+
                  "</frameset>"+
                  "</html>";
                  NFW.document.open();
                  NFW.document.write(frameString);
                  NFW.document.close();
                  }
                  else {
                  NFW = window.open(urlPop,"popFrameless","scrollbars,"+s);
                  NFW.blur();
                  window.focus();
                  NFW.resizeTo(windowW,windowH);
                  NFW.moveTo(windowX,windowY);
                  }
                  NFW.focus();
                 if (autoclose) {
                 window.onunload = function(){NFW.close();}
                }
               }
      
             </SCRIPT>
      </HEAD>
      
       <body>
              <a href="javascript:openFrameless()">Click Here</a>
       </body>

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Don't use document.all. Try something like this:
        [CODE=javascript]
        var windowW=214 // wide
        var windowH=398 // high
        var windowX = 260 // from left
        var windowY = 100 // from top
        var urlPop = "http://srv08-za119/fcParmalatTest/browse2.aspx?o= 739.html"
        var title = "This Is A Frameless Popup Window"

        var autoclose = true

        s = "width="+window W+",height="+wi ndowH;
        var NFW;
        function openFrameless() {
        NFW = window.open("", "popFrameless", "fullscreen=yes ,"+s);
        NFW.blur();
        window.focus();
        NFW.resizeTo(wi ndowW,windowH);
        NFW.moveTo(wind owX,windowY);
        var frameString=""+
        "<html>"+
        "<head>"+
        "<title>"+title +"</title>"+
        "</head>"+
        "<frameset rows='*,0' framespacing='0 ' border='0' frameborder='0' >"+
        "<frame name='top' src='"+urlPop+" ' scrolling='auto '></frame>"+
        "<frame name='bottom' src='about:blan k' scrolling='no'> </frame>"+
        "</frameset>"+
        "</html>";
        NFW.document.op en();
        NFW.document.wr ite(frameString );
        NFW.document.cl ose();
        }
        NFW.focus();
        if (autoclose) {
        window.onunload = function(){NFW. close();}
        }
        [/CODE]

        Comment

        • ismailc
          New Member
          • Sep 2006
          • 200

          #5
          Hi, Thank You - I have to aplogize for the late reply as i was sick for a few days.

          Unfortunately it does not work: click on link nothing happens

          but at the bottom stand error on page when check the no decription!


          Regards

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Remove the closing bracket } from line 31.

            Comment

            • ismailc
              New Member
              • Sep 2006
              • 200

              #7
              Hi, Thank You - we had a public holiday here in SA yesterday!

              I removed line 31 but no luck.

              When I clcik on the link to open in new window
              the address is: javascript:open Frameless()
              and: The Page cannot be displayed.

              Could it be with the href calling the script?

              Thank You

              Regards

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                The code displays a small popup window.

                See this link for a note on fullscreen. It's not supported in the newer browsers including IE.

                Comment

                • ismailc
                  New Member
                  • Sep 2006
                  • 200

                  #9
                  A Big Thank You, I really appreciate the help!

                  I only tried this because i could not change the border style of a drop down in HTML
                  Now i would have to think of another way!


                  Thank You

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    Originally posted by ismailc
                    I only tried this because i could not change the border style of a drop down in HTML
                    That should be possible. Post your code.

                    Comment

                    • ismailc
                      New Member
                      • Sep 2006
                      • 200

                      #11
                      Thank You, Please have a look!

                      I searched on google & it is said that this is not possible as I want to change the border color of a drop down & size.

                      This works fine on a normal text box!
                      I'm coding in Flwocentric which has a style property & i can change the xslt file
                      but the problem is that it can't change the drop downs border.

                      One can change the text color, width but not the border in HTML.

                      Code:
                      height : 19px; border : 1px solid #CCCCCC;
                      I saw a workaround where one has to add 4 images, one for each border side to hide the border, but i also don't know how.

                      Can you think of another way?

                      Regards

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        #12
                        Which browser are you using? In Firefox, for example, I can set the border whereas in IE6, it doesn't work. What you can do is put the select element in a span element and set the border on the span element.

                        Comment

                        • ismailc
                          New Member
                          • Sep 2006
                          • 200

                          #13
                          Hi, Thank You & once again i apologize for the late reply as it was my Eid yesterday.

                          I really hope this can work as I am using IE6.

                          Can you please give an example:

                          <Span><Style>

                          Regards

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            #14
                            Just as an example, to give you the idea:
                            [HTML]<span style="border: 1px solid red;"><select>< option>...</select></span>[/HTML]

                            Comment

                            • ismailc
                              New Member
                              • Sep 2006
                              • 200

                              #15
                              Thank You, I have to leave now!
                              Will try on Monday!

                              Thanks

                              Comment

                              Working...