Post by Ross on Jun 28, 2005 11:37:45 GMT -8
Many people have been having trouble with this code so I've updated it. Make sure this goes at the Top of the Main Header
Image Version
<script type="text/javascript">
<!--
var iImg = 'IMAGE URL';
if(!document.cookie.match(/splash=1/) && !location.href.match(/(board|action)=/))
{
document.cookie = 'splash=1;';
document.write('<style type="text/css">table,font,.hide{display:none;}.nohide{display: ;}</style>');
d = document.createElement('div');
with(d){ align = 'center'; appendChild(document.createElement('a')); }
with(d.lastChild){ href = location.href; appendChild(document.createElement('img')); }
with(d.lastChild.lastChild){ alt = 'Click to Enter'; border = '0'; src = iImg; }
document.body.appendChild(d);
}
// -->
</script>
Flash Version
<script type="text/javascript">
<!--
var iFlash = 'Flash URL';
iHeight = 'Flash Height';
iWidth = 'Flash Width';
if(!document.cookie.match(/splash=1/) && !location.href.match(/(board|action)=/))
{
document.cookie = 'splash=1;';
document.write('<style type="text/css">table,font,.hide{display:none;}.nohide{display: ;}</style>');
d = document.createElement('div');
with(d){ align = 'center';
appendChild(document.createElement('embed'));
for(l=0; l<2; l++) { appendChild(document.createElement('br')); }
appendChild(document.createElement('a')); }
with(d.lastChild){ href = '/index.cgi?'; appendChild(document.createTextNode('[Enter Site]')); }
with(d.firstChild){ border = '0'; src = iFlash; height = iHeight; width = iWidth;}
document.body.appendChild(d);
}
// -->
</script>
Advanced Users
This time round, I've built in two additional classes which will help you choose what additional things you want to display or hide on the welcome page. I know a few people had images which they didn't want to show before. These classes are hide which will be hidden on the splash page and nohide which will remain visible.
To set the class of an item, add a line like this to the opening tag class='classname' where the orange text is one of the above classnames. If the item you wish to do this to already has a class, then you can add multiple classes by leaving a space between their names.
ie. If I wanted a table to remain visible, I would use
<table class="bordercolor nohide" width="92%"......
If you have any problems with it, please post in Code Support
Image Version
<script type="text/javascript">
<!--
var iImg = 'IMAGE URL';
if(!document.cookie.match(/splash=1/) && !location.href.match(/(board|action)=/))
{
document.cookie = 'splash=1;';
document.write('<style type="text/css">table,font,.hide{display:none;}.nohide{display: ;}</style>');
d = document.createElement('div');
with(d){ align = 'center'; appendChild(document.createElement('a')); }
with(d.lastChild){ href = location.href; appendChild(document.createElement('img')); }
with(d.lastChild.lastChild){ alt = 'Click to Enter'; border = '0'; src = iImg; }
document.body.appendChild(d);
}
// -->
</script>
Flash Version
<script type="text/javascript">
<!--
var iFlash = 'Flash URL';
iHeight = 'Flash Height';
iWidth = 'Flash Width';
if(!document.cookie.match(/splash=1/) && !location.href.match(/(board|action)=/))
{
document.cookie = 'splash=1;';
document.write('<style type="text/css">table,font,.hide{display:none;}.nohide{display: ;}</style>');
d = document.createElement('div');
with(d){ align = 'center';
appendChild(document.createElement('embed'));
for(l=0; l<2; l++) { appendChild(document.createElement('br')); }
appendChild(document.createElement('a')); }
with(d.lastChild){ href = '/index.cgi?'; appendChild(document.createTextNode('[Enter Site]')); }
with(d.firstChild){ border = '0'; src = iFlash; height = iHeight; width = iWidth;}
document.body.appendChild(d);
}
// -->
</script>
Advanced Users
This time round, I've built in two additional classes which will help you choose what additional things you want to display or hide on the welcome page. I know a few people had images which they didn't want to show before. These classes are hide which will be hidden on the splash page and nohide which will remain visible.
To set the class of an item, add a line like this to the opening tag class='classname' where the orange text is one of the above classnames. If the item you wish to do this to already has a class, then you can add multiple classes by leaving a space between their names.
ie. If I wanted a table to remain visible, I would use
<table class="bordercolor nohide" width="92%"......
If you have any problems with it, please post in Code Support