SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Will this work?

  1. #1
    SitePoint Member
    Join Date
    Dec 2003
    Location
    Bringantine
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Will this work?

    <Head>
    </script>
    <script language="javascript" id="jcSpawn">
    // Jimco Add-ins Spawn JavaScript
    // This script is freely redistributable. //-->
    function spawnJimcoPopup(url, name, options, h, w, x, y, scaleType)
    {
    var windowOptions;
    if (scaleType == 'percent')
    {
    w = (w * screen.availWidth) / 100;
    h = (h * screen.availHeight) / 100;
    }
    if (x == 'center')
    {
    x = (screen.availWidth - w) / 2;
    y = (screen.availHeight - h) / 2;
    }
    windowOptions = options + ',width=' + w + ',height=' + h + ',left=' + x + ',top=' + y;
    newWindow = window.open(url, name, windowOptions);
    newWindow.focus();
    }
    </script>
    </Head>

    <body>
    onclick="spawnJimcoPopup('maingal/maingal.htm','05654F226F6A4180B4180B22D278DD72','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes','100','100','center','center','percent');return false;">
    </body>

    .........................
    I'm using the scrip above to make a popup window. I have several pages with different popup windows. If I were to place the Head part of the of the above code in a CSS and put the body part of the code In the body of each page (the 0565......8DD72 ID number on each page, I suppose, would have to change). Would this work?

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eh? Why would you want to put a JavaScript function in your CSS file?

    Include it as a JavaScript include in your <head>:

    <script type="text/javascript" src="jimco.js"></script>

  3. #3
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the way, I can't see how that '05654F226F6A4180B4180B22D278DD72' bit means anything at all - all it accomplishes is that the new window has that as a name. I suppose it prevents you opening new content in an already-opened pop-up, but it's a bit too careful...


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
  •