0
Welcome Guest! Login
0 items Join Now

Set popup windows size from menu item?

  • Set popup windows size from menu item?

    Posted 13 years 10 months ago
    • I want to open a popup link from the Joomla menu with the window being a specified size and without navigation. I suspect I will need to specify some parameters in the extended query strings but to be honest I have tried a lot of variables and nothing seems to work.

      Here is the code I am using from a module to give you an idea of what I am thinking.
      <p><a href="player.html" target="_blank" onclick="window.open('http://tunein.com/tuner/?StationId=93614','Player','width=450,height=310,left='+(screen.availWidth/2-225)+',top='+(screen.availHeight/2-100)+'');return false;"><img src="images/1.jpg" border="0" /></a></p>

      I would like to achieve this same effect from a menu item. Any ideas would be greatly appreciated.
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: Set popup windows size from menu item?

    Posted 13 years 10 months ago
    • Download the PHP/Javascript module from here
      code.google.com/p/joomla-php/downloads/list

      get either the top one (for joomla 1.6) or the second one down the list (joomla 1.5)

      Create a new 'PHP module' and enter this into the script box (you can change the sizes etc... if you need to)
       
      <script type="text/javascript">
      function mypopup()
      {
          mywindow = window.open("http://tunein.com/tuner/?StationId=93614", "mywindow", "location=1,status=1,scrollbars=0,  width=450,height=310");
          mywindow.moveTo(0, 0);
      }
      </script>
       

      Call the module whatever you want and turn the 'Show title' to disabled and the position to 'Debug'

      Then create a new menu item (External Link) and set the link to

      javascript: mypopup()

      All working smoothly :) anywhere that you call the 'javascript: mypopup()' will create the window.

      You can add more popup windows using the same module above and just adding to the JS code, anything in the Debug position is hidden.
      Ad,
    • Kiss my RSS
    • Big Chili's Avatar
    • Big Chili
    • Rocketeer
    • Posts: 68
    • Thanks: 0
    • Graphic Designer

    Re: Set popup windows size from menu item?

    Posted 12 years 10 months ago
    • man... this works like a champ!!!!
      Thanks!!!

      (I know it's a year old... but I like to give props where they are due!)

      chili
    • I wish I was as smart as I think I am.

Time to create page: 0.061 seconds