Help with POPUP window

Discussion in 'JavaScript' started by JohnS0N, Jun 23, 2008.

  1. #1
    First I would like to explain that I'm not a programmer and I borrowed this script from beating adwords and edited the button and forms with my limited html knowledge. You can view my modification here (the image is still the same, but I will of course change it with my own once I get this working)

    http://www.hoodiagordoniiguide.info/temp/

    The script isn't working good in IE... when you click on it to move it around it just sticks on your mouse and you can't click anywhere else. My first mission would be to get this working, but if this can't be done...then the whole moving around function could be deleted. Can someone help?

    Another thing is that this script will be on a dynamic website as opposed to now in .html. In wordpress to be exact. This will cause the script to appear every time a user clicks on a link or navigation. I don't want this to happen. I only want this script to display once to a user and if he closes the button it won't display anymore (or better yet for 24 hours)

    Now, can someone help me and tell me what to do? :eek:

    Thanks a lot in advance.

    The script is here:

    http://www.hoodiagordoniiguide.info/temp/CSS/scripts4.0.js

    And an empty html with only the code to call the script and position it is here:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>MY TITLE</title>
    <script language="javascript">
    function popUpTour(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=610,height=600');");
    }
    if (document.images)
    {
      preload_image = new Image(279,455);
      preload_image.src="images/popup/pop_up_money.png";
      preload_image2 = new Image(279,455);
      preload_image2.src="images/popup/pop_up_money.gif";
    }
    
    </script>
    <script src="CSS/scripts4.0.js" language="JavaScript"></script>
    </head>
    <body>
     <!-- Start Floating Layer -->
    <div id="FloatingLayer" style="position:absolute;width:300px;left:500;top:170;visibility:visible;">
      <table border="0" width="342" cellspacing="0" cellpadding="5" background="images/popup/pop_up_money.png".png" id="titleBar" style="cursor:move">
        <tr>
    
          <td width="100%">
    	  <table border="0" width="100%" cellspacing="0" cellpadding="0" height="300">
              <tr>
    			<td colspan=2 height="70"></td>
              </tr>
              <tr>
                <td width="239">&nbsp;</td>
                <td width="29" valign="top" style="cursor:hand"><br>
                  <strong><a href="#" onClick="ToggleFloatingLayer('FloatingLayer',0);return false"><font color="#FFFFFF" size="2" face="Tahoma"  style="text-decoration:none">X</font></a></strong></td>
    
              </tr>
              <tr>
                <td colspan="2" height="245"></td>
              </tr>
              <tr>
                <td style="padding:4px" colspan="2" height="100" align="center">
                    <table>
                      <tr>
                        <td></td>
                        <td align="center" colspan="4"><INPUT TYPE="button" value="TEXT HERE" onClick="parent.location='http://www.google.com'"></td>
                      </tr>
                    </table>
                  <!-- End of content area --></td>
              </tr>
            </table></td>
    
        </tr>
        <tr>
          <td height="0"></td>
        </tr>
      </table>
    </div>
    <!-- End Floating layer -->
    </body>
    </html>
    
    Code (markup):

     
    JohnS0N, Jun 23, 2008 IP
    Abhik likes this.
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    yes check if an cookie exists, if not create one, if so, ignore the 'popup' search on google for javascript cookies and you'll find alot of info :)
     
    EricBruggema, Jun 26, 2008 IP