Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Smile Content that cover a website,and disappear after click.

    Hello!

    I hope this is the right forum section.

    What I'm looking for is a script that does this when a visitor open a website (EVERYTIME!!!, might sound a bit spammy, but it won't be, trust me.)
    I.e:
    1. Visitor open the website, and the content opens in the middle of the screen.
    The user can't click anywhere, expect on the content. The content will link to an adress.
    2. After the visistor clicked on the content, it will disepear, untill next open / refresh.

    The 'content' is for example ad (ad from my website / anything else that allow it!)

    Is this possible, and if so, could you guys /lads help me? Thanks ALOT if you could!

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Question You really want to do this ... ?

    No need to link to another address, just open the rest of the current document.

    Notes:
    1. Won't work if JS is dis-abled by user.
    2. Will probably aggravate the user no end to do clicks every time they visit/refresh the page.
    3. If #2 is true then your visit count will go down.

    If you are still interested, then add your code between the 2nd <div> tags.

    Code:
    <html>
    <head>
    <title>Agree to Continue</title>
    <script type="text/javascript">
    // From: http://www.codingforums.com/showthread.php?t=169507
    
    function AgreeToOpen() {
      document.getElementById('AgreePage').style.display='none';
      document.getElementById('MainPage').style.display='block';
    }
    </script>
    </head>
    <body>
    <noscript>
    <h1>Note: This program won't work for you! <p>
    Your browser does not have Javascript enabled.
    </noscript>
    <div id="AgreePage" onclick="AgreeToOpen()">
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <center>
    <h2>Click anywhere to Continue ...</h2>
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    </center>
    </div>
    
    <div id="MainPage" style="display:none">
    Rest of document
    </div>
    </body>
    </html>

  • Users who have thanked jmrker for this post:

    Danne206 (06-18-2009)

  • #3
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    No need to link to another address, just open the rest of the current document.

    Notes:
    1. Won't work if JS is dis-abled by user.
    2. Will probably aggravate the user no end to do clicks every time they visit/refresh the page.
    3. If #2 is true then your visit count will go down.

    If you are still interested, then add your code between the 2nd <div> tags.

    Code:
    <html>
    <head>
    <title>Agree to Continue</title>
    <script type="text/javascript">
    // From: http://www.codingforums.com/showthread.php?t=169507
    
    function AgreeToOpen() {
      document.getElementById('AgreePage').style.display='none';
      document.getElementById('MainPage').style.display='block';
    }
    </script>
    </head>
    <body>
    <noscript>
    <h1>Note: This program won't work for you! <p>
    Your browser does not have Javascript enabled.
    </noscript>
    <div id="AgreePage" onclick="AgreeToOpen()">
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <center>
    <h2>Click anywhere to Continue ...</h2>
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    </center>
    </div>
    
    <div id="MainPage" style="display:none">
    Rest of document
    </div>
    </body>
    </html>
    Works awsome so far, but my ad is flash-type, look's like this (example
    http://img191.imageshack.us/img191/3072/htmllll.jpg
    and after I click on it, it won't dissepear.
    Any solution?
    Thanks for help

  • #4
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts
    Put your image between the 1st <div> tags region.

    Post the code you are using, not just repeat of the code given.

  • #5
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I might be slow, but I'll blame it on that I'm super tired .
    The code looks like:
    Code:
    <html>
    <head>
    
    <title>Agree to Continue</title>
    
    <div><script type="text/javascript">
    // From: http://www.codingforums.com/showthread.php?t=169507
    
    function AgreeToOpen() {
      document.getElementById('AgreePage').style.display='none';
      document.getElementById('MainPage').style.display='block';
    }
    </script>
    </head>
    <body>
    <noscript>
    <h1>Note: This program won't work for you! <p>
    Your browser does not have Javascript enabled.
    </noscript>
    <div id="AgreePage" onclick="AgreeToOpen()">
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <center>
    <h2><script type="text/javascript">
    var uri = 'http://impse.XXXX.com/imp?type(js)pool(XXX110)a(1XXXX3255)' + new String (Math.random()).substring (2, 11);
    document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    </script></h2>
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    </center>
    </div>
    
    <div id="MainPage" style="display:none">
    Rest of document
    </div>
    </body>
    </html>
    ATM, but I want the image do dissepear ONLY when you click it, not next to it or anywhere else, just on it.

    Possible?

  • #6
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Lightbulb Try this ...

    Note:
    ATM, but I want the image do dissepear ONLY when you click it, not next to it or anywhere else, just on it.
    Your image size is 1200x593.

    It is really hard to click on it without also being able to "click it, not next to it or anywhere else, just on it."

    Create image of the desired size and then change this section ...
    Code:
    <div id="AgreePage">
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <center>
    <img src='' id="ImageToDisplay" onclick="AgreeToOpen()"
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    </center>
    </div>
    Fill in source of smaller .jpg in <img> tag above.

    Note: I don't know if this part will work or not. No way to test on my local computer
    <h2><script type="text/javascript">
    var uri = 'http://impse.XXXX.com/imp?type(js)pool(XXX110)a(1XXXX3255)' + new String (Math.random()).substring (2, 11);
    document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    </script></h2>

  • Users who have thanked jmrker for this post:

    Danne206 (06-18-2009)

  • #7
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    Note:

    Your image size is 1200x593.

    It is really hard to click on it without also being able to "click it, not next to it or anywhere else, just on it."

    Create image of the desired size and then change this section ...
    Code:
    <div id="AgreePage">
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <center>
    <img src='' id="ImageToDisplay" onclick="AgreeToOpen()"
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    </center>
    </div>
    Fill in source of smaller .jpg in <img> tag above.

    Note: I don't know if this part will work or not. No way to test on my local computer

    The
    Code:
    <h2><script type="text/javascript">
    var uri = 'http://impse.XXXX.com/imp?type(js)pool(XXX110)a(1XXXX3255)' + new String (Math.random()).substring (2, 11);
    document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    </script></h2>
    is the adcode, wich will generate the image.
    The whole ad code is:

    <script type="text/javascript">
    var uri = 'http://impse.tradedoubler.com/imp?type(js)pool(339110)a(1673255)' + new String (Math.random()).substring (2, 11);
    document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    </script>

    You think you could help me solve this?

    Thanks for the help so faar!

  • #8
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Exclamation

    I have never heard of nor do I have or use an 'ad image generator', so I don't know if this will help ...

    Try this replacement with the previous post #2 recommendations:
    Code:
    <div id="AgreePage">
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <center>
    <h2 onclick="AgreeToOpen()">
    <script type="text/javascript">
    var uri = 'http://impse.XXXX.com/imp?type(js)pool(XXX110)a(1XXXX3255)' + new String (Math.random()).substring (2, 11);
    document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>');
    </script></h2>
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    </center>
    </div>

  • Users who have thanked jmrker for this post:

    Danne206 (06-18-2009)

  • #9
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Works much better now, though, it'll still disepear if i click a bit outsidei it.
    It is possible to fix so it ONLY dissepear after I click on the image, not next to it?

    It is easier if the image would only be 1 size?
    I'll keep it to 120px × 600px then.

    DEMO atm: http://danne206.myhood.se/support.html

  • #10
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts
    It's possible, but I suspect it has to do with the size created by your 'image generator'.

    To show the example, temporarily remove the image generation logic ( <script...>...</script> ) stuff
    and replace with a simple 200x200 image like <img src="small_jpg_or_gif">.

    Should limit clicking to image display ONLY!

  • #11
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    It's possible, but I suspect it has to do with the size created by your 'image generator'.

    To show the example, temporarily remove the image generation logic ( <script...>...</script> ) stuff
    and replace with a simple 200x200 image like <img src="small_jpg_or_gif">.

    Should limit clicking to image display ONLY!
    Well, removing the generating code isn't possible.
    The image will always be 120px × 600px now though, dosn't help though ?

  • #12
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Arrow

    So try using a 120 x 600px image for proof of concept!

  • #13
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    So try using a 120 x 600px image for proof of concept!
    I'll mix around with it!

    Thanks ALOT for the help!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •