SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    trying to have lightbox disclaimer popup once per visit for adult website

    I run an adult social network. I'm trying to have a lightbox disclaimer popup once per user visit with an accept/decline button at the bottom.

    I don't want the user to be able to click out of the lightbox, scroll the window in the back ground, or get around the lightbox any other way...

    Currently, I paid someone to do this for me and this is the code they came up with. The problem is, all it does is show a white box in the middle of the page, no disclaimer, no content. Also, the webpage in the background is still scrollable...

    any ideas anyone?!?

    HTML Code:
    <script type="text/javascript" src="/externals/thickbox/jquery-latest.pack.js"></script>
    <script type="text/javascript" src="/externals/thickbox/thickbox.js"></script>
    <link rel="stylesheet" href="/externals/thickbox/thickbox.css" type="text/css" media="screen" />
    <script type="text/javascript">
    
    function del_cookie(name)
    {
    
    	document.cookie = name +'=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
    	self.close();
    
    }
    
    function setcookie(cookieName,cookieValue,nDays)
    {
    
    var today = new Date();
    
    var expire = new Date();
    
    if (nDays==null || nDays==0) nDays=1;
    
    expire.setTime(today.getTime() + 3600000*24*nDays);
    
    document.cookie = cookieName+"="+escape(cookieValue)
    
    + ";expires="+expire.toGMTString();
    
    }
    
    function savecookie(){
    
    setcookie("agreedisclaimer",1,365);
    
    document.location="/index.php";
    
    
    }
    
    function getcookie(c_name)
    {
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=");
      if (c_start!=-1)
        {
        c_start=c_start + c_name.length+1;
        c_end=document.cookie.indexOf(";",c_start);
        if (c_end==-1) c_end=document.cookie.length;
        return unescape(document.cookie.substring(c_start,c_end));
        }
      }
    return "";
    }
    
    jQuery(document).ready(function(){
    	
    	if(getcookie("agreedisclaimer")==null || getcookie("agreedisclaimer")==""){
    
    		tb_show('', 'http://www.mywebsite.com/disclaimer.html?height=400&width=700&modal=true', '');
    
    
    	}	
    
    });
    
    </script>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by sistom View Post
    Currently, I paid someone to do this for me and this is the code they came up with. The problem is, all it does is show a white box in the middle of the page, no disclaimer, no content. Also, the webpage in the background is still scrollable...

    any ideas anyone?!?
    If you would you like to employ someone to take your project through to completion, there's the url="http://marketplace.sitepoint.com/"]marketplace[/url].
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •