Dynadot โ€” .com Registration $8.99

Need Help With JS Code

Spaceship Spaceship
Watch

resellerlogic

Established Member
Impact
7
I'm looking to create a custom splash page. aka full page ad/interstitial

Example of the page I'm trying to create can be find by visiting this site.

http://imgchili.com/show/396/396314_691404701.jpg

Notice how it was the Continue to Image link when you click it. I'm looking for a way to do that. Spent hours searching google and no luck.

Any help is appreciated.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Not How I would do it.....

Basically they have an image that scales to the whole window which is viewable and the actual page is hidden in a div.

Once you click the text (not a true link) - it hides the image and the text and makes the invisible div (the actual page) visible.
 
0
•••
Yep, they just use .htaccess mod_rewrite so it shows that page first.
 
0
•••
How would you go about doing that?
 
0
•••
0
•••
I saw that. I'm just not sure how I would apply that into a .htaccess
 
0
•••
It really depends on exactly what you want to do.

You want a splash page all the time?
Only on the first visit?
Only on the first visit per page?
Only if the visit is to the site directly?

If the link is used as an IMG src should it render the JPG ?

I would tend to use .htaccess to convert the request into a specific php page and do it all there with PHP and ignore the javascript - use a real link.

I'd use the following technique.

http://stackoverflow.com/questions/2441339/htaccess-mod-rewrite-for-passing-get-parameters
 
0
•••
What I basically need it to do is display that splash page on the first visit per page. or once per 24 hours.

Unfortunately that link you sent me doesn't help me much since I'm not familiar with what to do at all.
 
Last edited:
0
•••
0
•••
Code:
<!DOCTYPE html popUpBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Title Page</title>
<META http-equiv=Content-Type content="text-html; charset=UTF-8">
</head>
<body>
<!--The Popup Box Layout Start -->
<style>
.popupOverlay {
    position:absolute;    background-color:#000000;
    display:none;	height:300%;
    left:0;  top:0;
    width:100%;  z-index:6;
}
</style>

<div class="popupOverlay" id="popupOverlay" style="display: none; opacity: 0.9; filter:alpha(opacity=90); -moz-opacity:0.9;">
<div style="border: 5px solid #ccc; padding: 20px; z-index: 1000; position: relative; margin:200px auto;display: none; font-size: 18px; width: 300px; height: 130px; text-align: center;opacity: 1; filter:alpha(opacity=100); -moz-opacity:1;background-color: white;" id="popupBox">
<br/>Press Button to Continue<br/>
<a style="font-size: 24px; padding-left: 10px; padding-right: 10px;" class="buttonblue" href="javascript:doClose();">ENTER</a><br/>
<a style="font-size: 12px;" href="JavaScript:location.replace('http://www.fark.com');">fark off</a><br/>
</div>
</div>
<!--The Popup Box Layout End -->

<!--The Popup Box Javascript to show Begin -->
<script>
var showPopup = true;
//If Cookie is set then don't show - remove this line if you always want and just leave at true
if (getCookie("popupOverlay") != null)
{
	showPopup = false;
}

var popupOverlay=document.getElementById("popupOverlay");
var popupBox=document.getElementById("popupBox");

if(showPopup==true){
    popupBox.style.display="block";
    popupOverlay.style.display="block";
   
}

function doClose(){
    popupBox.style.display="none";
    popupOverlay.style.display="none";
    var exp = new Date();    
    exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24));
    setCookie('popupOverlay','1', exp);
}

function setCookie(name, value, expires) {
  document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

function getCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) {
	
       return getCookieVal (j);
      }
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
    }
  return null;
  }
</script>

<!--The Popup Box Javascript to show End -->
<!--Your Normal Page-->

HELLO WORLD!!!<BR />
I am here but hidden until accepted
</body>
</html>


This is the last example

Shows a Box with a Press Button to continue. It will ONLY show if the Cookie is not set. If you hit CONTINUE then it sets a cookie and you won't be prompted again.

Remove the "getCookie" line and it will show ALWAYS - even if you reload.

The style is "borrowed" from the last example you show :) If you have lots of other Javascript going on then you may need to put this in a function and call it from the "window.onload = " piece.

You can change the "Fark off" option :)
 
Last edited:
0
•••
I advise not to do that. It enoys to always get popups with ads on websites.
 
0
•••
Is there anyway to when you click enter open a new window as well as closing it? Seems to be what they do and many other sites.
 
0
•••
Is there anyway to when you click enter open a new window as well as closing it? Seems to be what they do and many other sites.

I didn't get my $15 PP last time round, lol ;)









I'm kidding.
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back