InterOcean Designs
« Full Window Splash Portal »

Welcome Guest. Please Login or Register.
May 19, 2013, 3:04am




InterOcean Designs :: ProBoards Codes :: ProBoard Code Database :: Full Window Splash Portal
Page 1 of 4 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: Full Window Splash Portal (Read 2,127 times)
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Full Window Splash Portal
« Thread Started on Mar 7, 2011, 11:45am »

Full Window Splash Portal by SubDevo
Tested in IE, FF, Opera, Safari and Chrome.

This code allows you to create your own custom splash/portal page for your main page.
This code doesn't care if you use a custom domain or if the user enters with (or without) "index.cgi" in the URL (like other portal codes).
You choose how often the splash page is shown.
You have an option to keep the page always in view or have it scroll with the page.
This code uses cookies. So, if a user has cookies disabled or deletes them, they will see the splash page again.

Enjoy!!! :)
SubDevo

The code is in three parts. The CSS (style), the mySplashPage div (contains your HTML for the splash page) and the script itself.

For the CSS, do not modify (or remove) anything above and including z-index.
They are needed for proper operation of the splash page.

The mySplashPage div is where you put all your HTML for your splash page.
Replace the Yellow part with your own HTML.

<div id="mySplashPage" style="display:none;">
<center>
<!-- Splash Content BELOW here -->

<div style="position:relative;top:200px;width:400px;border:1px solid #FF0000;">
<br /><br /><br /><br /><br />
<font size="6">Welcome to our forum!</font>
<br /><br /><br /><br /><br />
<a href="javascript:closeSplash()">ENTER</a>
<br /><br />
</div>


<!-- Splash Content ABOVE here -->
</center>
</div>


The link to close the splash is this: <a href="javascript:closeSplash()">ENTER</a>
You can change the text in this or even use an image link, like so:
<a href="javascript:closeSplash()"><img src="URL TO IMAGE" /></a>
You can also have it so the user can just click anywhere on the screen to close the page, by adding the Yellow to this line:
<div id="mySplashPage" onclick="closeSplash()" style="display:none;">

Variables:

var keepInView=1; // Keep top of splash page always in view? 1=Yes, 0=No
If this is set to 0, your page will scroll when the user scrolls the page.
If set to 1, your page will always stay in view.

var mExp=-1; // Days before expires.
Enter the amount of days before the user will see the splash page again.
There are a couple "special" values here. 0 days will show the splash page one time for the user, while browsing your forum. When they exit their browser (not tab), they will see the splash page again.
If this is set to a negative number (code default), the user will see the splash page EVERY TIME they go to the main page. This is great for testing. Other than that, it could get annoying. So, make sure you change this once you are done testing.

Location: Global Header
Code:
<style type="text/css">
<!--
#mySplashPage{
&nbsp; &nbsp;position: absolute;
&nbsp; &nbsp;top: 0px;
&nbsp; &nbsp;left: 0px;
&nbsp; &nbsp;width: 100%;
&nbsp; &nbsp;height: 100%;
&nbsp; &nbsp;z-index: 10;
&nbsp; &nbsp;text-align: center;
&nbsp; &nbsp;color: #FFFFFF;
&nbsp; &nbsp;background-color: #000000;
}
-->
</style>

<div id="mySplashPage" style="display:none;">
<center>
<!-- Splash Content BELOW here -->

<div style="position:relative;top:200px;width:400px;border:1px solid #FF0000;">
<br /><br /><br /><br /><br />
<font size="6">Welcome to our forum!</font>
<br /><br /><br /><br /><br />
<a href="javascript:closeSplash()">ENTER</a>
<br /><br />
</div>

<!-- Splash Content ABOVE here -->
</center>
</div>

<script type="text/javascript">
/* Full Window Splash Portal by SubDevo */
/* Global Header - Please leave this header intact. Do not repost. */
/* [url]http://interoceandesigns.com[/url] or [url]http://lsdp.proboards.com[/url] */

var keepInView=1; // Keep top of splash page always in view? 1=Yes, 0=No
var mExp=-1; // Days before expires.

function splashHeight(a){ var m=document.body,b=m.scrollTop;
&nbsp; &nbsp;(keepInView)?mY_s.style.top=b:mY_s.style.height=m.clientHeight+b;
}
function splashCook(){ var ex="",d=new Date();
&nbsp; &nbsp;if(mExp!=0){ d.setTime(d.getTime()+(mExp*86400000));
&nbsp; &nbsp;&nbsp; &nbsp;ex=" expires="+d.toUTCString()+";";
&nbsp; &nbsp;} document.cookie="mySplashPage=1;"+ex+" path=/";
} var gotCook=/mySplashPage=1/i.test(document.cookie); splashCook();
if(pb_action=="home"&&!gotCook){
&nbsp; &nbsp;var mY_s=document.getElementById("mySplashPage");
&nbsp; &nbsp;mY_s.style.display=""; splashCook();
&nbsp; &nbsp;if(document.uniqueID){window.attachEvent("onscroll", splashHeight);}
&nbsp; &nbsp;else{(keepInView)?mY_s.style.position="fixed":window.addEventListener("scroll", splashHeight, false);}
}
function closeSplash(){ mY_s.innerHTML=""; mY_s.style.display="none";
&nbsp; &nbsp;(window.detachEvent)?window.detachEvent("onscroll", splashHeight):window.removeEventListener("scroll", splashHeight, false);
}
</script>
« Last Edit: Aug 16, 2011, 2:31am by SubDevo »Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
OJ
Moderator
member is offline

[avatar]

[yim] [msn]
[homepage]

Joined: Nov 2010
Gender: Male
Posts: 976
Location: California
Karma: 53
 Re: Full Window Splash Portal
« Reply #1 on Mar 7, 2011, 12:11pm »

Haha! Very cool Sub! Awesome :)
Link to Post - Back to Top  IP: Logged

[image]
OJ
Moderator
member is offline

[avatar]

[yim] [msn]
[homepage]

Joined: Nov 2010
Gender: Male
Posts: 976
Location: California
Karma: 53
 Re: Full Window Splash Portal
« Reply #2 on Mar 11, 2011, 11:19am »

Umm Sub, I got a question. I'm trying to put my flash in the background through the CSS, is this possible? If so how? I already tried using the 'background-image: url(URL HERE);' and it doesn't work. Any suggestions?

EDIT:

Ok if the above isn't possible, would it be possible to move the 'Enter' button on TOP of the flash? Not above the flash, but on top. Catch my drift?
« Last Edit: Mar 11, 2011, 12:12pm by OJ »Link to Post - Back to Top  IP: Logged

[image]
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Full Window Splash Portal
« Reply #3 on Mar 11, 2011, 12:46pm »

You can't set a flash file as a background image in CSS. But, you can easily move the "Enter" button (and any other HTML) on TOP of the flash. Notice our menu buttons are on top of our flash banner?
Do you have a test site with your splash page that I can look at?
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
OJ
Moderator
member is offline

[avatar]

[yim] [msn]
[homepage]

Joined: Nov 2010
Gender: Male
Posts: 976
Location: California
Karma: 53
 Re: Full Window Splash Portal
« Reply #4 on Mar 11, 2011, 1:23pm »

Yeah I do, I already put the flash in it. Clicky
Link to Post - Back to Top  IP: Logged

[image]
GFX Support
GFX Designer
member is offline

[avatar]

Off duty



Joined: Apr 2009
Gender: Male
Posts: 1,962
Karma: 75
 Re: Full Window Splash Portal
« Reply #5 on Mar 11, 2011, 2:13pm »

This is how I did it. 8-)

My testsite
Link to Post - Back to Top  IP: Logged

I'm off duty! For questions or support please contact RADesign or Speed Demon.
OJ
Moderator
member is offline

[avatar]

[yim] [msn]
[homepage]

Joined: Nov 2010
Gender: Male
Posts: 976
Location: California
Karma: 53
 Re: Full Window Splash Portal
« Reply #6 on Mar 11, 2011, 2:44pm »

Oh thats cool RAD! That's how I want it, except that I'll make it so that you click on the 'Welcome...' text instead of outside the image. :)
Link to Post - Back to Top  IP: Logged

[image]
OJ
Moderator
member is offline

[avatar]

[yim] [msn]
[homepage]

Joined: Nov 2010
Gender: Male
Posts: 976
Location: California
Karma: 53
 Re: Full Window Splash Portal
« Reply #7 on Mar 13, 2011, 7:08am »

Ok so Sub, I got the images done (thanks to RAD ;) ) for my splash. Now there's only one more thing I want to add. Would it be possible to add some music to the splash? I already got the link to the song I want, all I need is the html code or something to add it. I just want the music to play in the background. I don't want a button for it, since people probably won't stay very long looking at the splash lol :P Is this possible?

EDIT:

Ok, I just found out something odd about the splash. Whenever I first go to my forum, and I close the splash, for some reason I'm not able to scroll anywhere using my mouse scroll. I have to click on the scroll button to actually go down or use the down/up arrows. But once I refresh, everything is normal again. I can scroll down with my mouse and/or by clicking on the arrows, or scroll buttons.


SECOND EDIT: Ok, this only happens with FF. ???
« Last Edit: Mar 13, 2011, 8:40am by OJ »Link to Post - Back to Top  IP: Logged

[image]
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Full Window Splash Portal
« Reply #8 on Mar 13, 2011, 10:51am »

You want to add MORE to download on that page? mp3 file size will be larger than the flash banner.
Unless it is a very small clip and/or midi file. In this case, it might be best to add it into the flash itself, otherwise, I would have to make code to embed it then shut it off when you click off the splash. PM me the link to your music file please.

Hmmm... You are right the scroll doesn't work in FF like you said. Strange thing is, on YOUR site, if you click anywhere in your banner (after closing the splash), the scroll magically works again. After tearing apart my code, I found out the issue is not in the code, but the flash itself. And it must have something to do with the flash button code because if I use your site banner for the flash splash or if I click outside the flash to close it (without clicking the button), I do not get the scroll issue.
So, Rad, we may have to play with the events of that button on the banner. I don't know how you have that button set up. Maybe change the "target" attribute? Maybe, instead of setting it up as a link, is there a way to give the button an "onclick" event instead of a URL with an href? If so, the onclick event would be closeSplash(). I'll have to get with you on this...
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
GFX Support
GFX Designer
member is offline

[avatar]

Off duty



Joined: Apr 2009
Gender: Male
Posts: 1,962
Karma: 75
 Re: Full Window Splash Portal
« Reply #9 on Mar 13, 2011, 1:56pm »

Do you have the same problem at my testsite? I don't. :P
Not with Avant, IE or FF.


EDIT:
I don't encounter this problem at YOUR site either, using any of the above browsers!
« Last Edit: Mar 13, 2011, 2:00pm by GFX Support »Link to Post - Back to Top  IP: Logged

I'm off duty! For questions or support please contact RADesign or Speed Demon.
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Full Window Splash Portal
« Reply #10 on Mar 13, 2011, 2:04pm »

Yup. I have the same problem at your test site with FF. The issue doesn't arise unless you actually wait and click the button to remove the splash page. Clicking outside the flash to remove it, everything is peachy!
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
GFX Support
GFX Designer
member is offline

[avatar]

Off duty



Joined: Apr 2009
Gender: Male
Posts: 1,962
Karma: 75
 Re: Full Window Splash Portal
« Reply #11 on Mar 13, 2011, 4:22pm »

I'm using FF 3.5.17 and I really don't have any problems scrolling with my scroll-wheel after I click the button. (Logitech Performance MX mouse)
Link to Post - Back to Top  IP: Logged

I'm off duty! For questions or support please contact RADesign or Speed Demon.
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Full Window Splash Portal
« Reply #12 on Mar 13, 2011, 5:06pm »

Hmm. I'm using latest FF 3.6.15. Seems it may be a latest FF version issue then? Do you want to try updating your FF and see if you get the issue?
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
OJ
Moderator
member is offline

[avatar]

[yim] [msn]
[homepage]

Joined: Nov 2010
Gender: Male
Posts: 976
Location: California
Karma: 53
 Re: Full Window Splash Portal
« Reply #13 on Mar 13, 2011, 6:13pm »

Well, now that I think of it better, lets just forget about the music shall we? lol :P

Now, regarding the scrolling problem, yes it happens to me on your test site too RAD, but like you guys said, if I click outside the image, then everything is cool.
I mean its no biggie for me, its just something that I noticed, and wanted to bring to your attention just in case it bothered anyone else using your code Sub. ;)
Link to Post - Back to Top  IP: Logged

[image]
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Full Window Splash Portal
« Reply #14 on Mar 13, 2011, 6:36pm »

Well, like I said, it isn't the code. It has something to do with the way FF handles the link in the flash file. Since Rad isn't getting the issue with an older version, it seems to me that SOMETHING has changed in the newest version of FF. But it IS bugging me...
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
Page 1 of 4 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile