...

View Full Version : Content that cover a website,and disappear after click.



Danne206
06-18-2009, 03:18 AM
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!

jmrker
06-18-2009, 04:47 AM
No need to link to another address, just open the rest of the current document.

Notes:
:o 1. Won't work if JS is dis-abled by user.
:mad: 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.



<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>

Danne206
06-18-2009, 05:01 AM
No need to link to another address, just open the rest of the current document.

Notes:
:o 1. Won't work if JS is dis-abled by user.
:mad: 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.



<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 :)

jmrker
06-18-2009, 05:19 AM
Put your image between the 1st <div> tags region.

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

Danne206
06-18-2009, 12:25 PM
I might be slow, but I'll blame it on that I'm super tired :).
The code looks like:


<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?

jmrker
06-18-2009, 08:03 PM
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 ...


<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>

:)

Danne206
06-18-2009, 08:41 PM
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 ...


<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


<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!

jmrker
06-18-2009, 10:42 PM
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:


<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>

Danne206
06-18-2009, 10:59 PM
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

jmrker
06-19-2009, 01:15 AM
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!

Danne206
06-19-2009, 02:09 AM
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 :o?

jmrker
06-19-2009, 03:04 AM
So try using a 120 x 600px image for proof of concept! :eek:

Danne206
06-19-2009, 10:42 AM
So try using a 120 x 600px image for proof of concept! :eek:

I'll mix around with it!

Thanks ALOT for the help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum