0
Welcome Guest! Login
0 items Join Now

Pop Up Window in Main Heading

    • Melissa Rohr's Avatar

    Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • Hi All,
      I am using extremities 2 template. I have a link to an html page in the main menu. The link opens in a new window and the page displays fine. However, I the window to be a pop up window - not a full page.

      For instance, I have abc.com as my main domain. In the Main Heading, I have a link to dogs.com/coupon.html. When someone clicks the link in my main heading at my website, the dogs.com/coupon.html page pops up.

      I want the dogs.com/coupon.html page to be  100 x 100 - not a full page.

      I dont think this is an issue with the code on the dogs.com page but how Joomla opens a new window. Correct? If anyone could answer my question, I would be forever greatful! 

      I have the following code in my dogs.com/coupon.html page:

      <html>
      <head>
      <title>Coupon at Dogs.com</title>
      <script language="JavaScript" type="text/javascript">
      <!--
      function open_win(what_link){
      var the_url = " www.dogs.com/coupon.html "
      var the_x = 100;
      var the_y = 100;
      the_x -= 0;
      the_y -= 0;
      var how_wide = screen.availWidth;
      var how_high = screen.availHeight;
      if(what_link != ""){the_url=what_link;}
      var the_toolbar = "yes";
      var the_addressbar = "yes";
      var the_directories = "yes";
      var the_statusbar = "yes";
      var the_menubar = "yes";
      var the_scrollbars = "no";
      var the_do_resize =  "yes";
      var the_copy_history = "yes";
      top_pos = (how_high/2) -  (the_y/2);
      left_pos = (how_wide/2) -  (the_x/2);
      if (window.outerWidth ){
      var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",outerWidth="+the_x+",outerHeight="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
      site=open(the_url, "DisplayWindow", option);
      var Opera = (navigator.userAgent.indexOf('Opera') != -1);
      if(Opera){
      site.resizeTo(the_x,the_y);
      site.moveTo(0,0);
      }
      }
      else
      {
      var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",Width="+the_x+",Height="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
      site=open('', "DisplayWindow", option);
      site.location=the_url;
      if(site.open){site.focus();return false;}
      site.resizeTo(the_x,the_y);
      }
      }
      // -->
      </script>

      </head>

      Can someone tell if this is possible with Mambo/Joomla? 
    • Fox's Avatar
    • Fox
    • Rocketeer
    • Posts: 71
    • Thanks: 0

    Re: Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • Hi.
      I use this in my Mambo site.

      in Index.php:

      <script language="JavaScript" type="text/JavaScript">
      var popUpWin=0;
      function popUpWindow(URLStr, left, top, width, height)
      {
        if(popUpWin)
        {
          if(!popUpWin.closed) popUpWin.close();
        }
        popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
      }
      </script>


      The link:
      (as hyperlink in a image, or as a link in the menu)

      javascript:popUpWindow(' www.yoursite.com/filename.php',%20'200px...%20'450px',%20'360px ')


      Just edit the size of the popup window in the link. (Currently 450px X 360px)
      Should work perfectly.. :)
    • Last Edit: 18 years 1 month ago by Fox.
    • Melissa Rohr's Avatar

    Re: Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • Thanks for your reply. I add this code above the index of the template above the </head> correct? Or the index.php of the joomla site in the root?

      And the pop up needs to = 1 to turn on?

      <script language="JavaScript" type="text/JavaScript">
      var popUpWin=1;
      function popUpWindow(URLStr, left, top, width, height)
      {
      if(popUpWin)
      {
      if(!popUpWin.closed) popUpWin.close();
      }
      popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='100',height='100',left='100', top='100',screenX='100',screenY='100'');
      }
      </script>

      </head>

      This will make all windows that open in the new window the same size wont it?
    • Fox's Avatar
    • Fox
    • Rocketeer
    • Posts: 71
    • Thanks: 0

    Re: Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • You put the script above </head> in the document that has the link to the popup window.

      1. If you dont add the "javacript link" that calls the javascript, all windows that open will just be standard browser window.

      2. If you add the "javascript link" that calls the script, the popup window will be as big as you want, individually set by parameters in the link.

      3. you can have as many popup windows as you want on a webpage, and each popup window can have different size.

      ..you choose the size of the popup window... in the link that opens the popup.. :)
    • Melissa Rohr's Avatar

    Re: Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • Hm.. Maybe I havent explained myself correctly. It is in the topmenu. Please see image as example. If I want the mini radio which is a link in the top menu, to be a popup of coupon.html and it owuld be 100x100 what would I do?
    • Fox's Avatar
    • Fox
    • Rocketeer
    • Posts: 71
    • Thanks: 0

    Re: Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • Melissa Rohr wrote:
      Hm.. Maybe I havent explained myself correctly. It is in the topmenu. Please see image as example. If I want the mini radio which is a link in the top menu, to be a popup of coupon.html and it owuld be 100x100 what would I do?

      1. Put the javascript in the index.php (template file)
      2. Put the "javascript link" in the  link adress field when you create the menulink in joomla/mamo

      (Take a look at the picture: )
    • Last Edit: 18 years 1 month ago by Fox.
    • Melissa Rohr's Avatar

    Re: Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • Your last screenshot helped. I was forgetting the javascript:popUpWindow before the url!

      Thank you for your persistence, CHK!
    • Fox's Avatar
    • Fox
    • Rocketeer
    • Posts: 71
    • Thanks: 0

    Re: Pop Up Window in Main Heading

    Posted 18 years 1 month ago
    • Melissa Rohr wrote:
      Your last screenshot helped. I was forgetting the javascript:popUpWindow before the url!

      Thank you for your persistence, CHK!

      ...any time.. ;)

Time to create page: 0.043 seconds