facebook twitter youtube
in JavaScripts - 29 Mar, 2011, This Tutorial Has Been Viewed 28,437 Times.
by admin - one comment
Add a splash page using javascript
VN:F [1.9.22_1171]
Rating: 6.3/10 (6 votes cast)

This tutorial will show you how to add a splash page on your website using javascript. Here i am using iframe tag. You are free to use FRAME or any other according to your convenience.

You can even modify this code for developing a image slideshow frame by dynamically adding image tag with some opacity switch along with our css.


<!-- TWO STEPS TO INSTALL SplashPage:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<script LANGUAGE="JavaScript">
<!-- Begin
var background = "black";
var text = "white";
var URL = "http://mistonline.in/wp/";
var speed = 4000; // time in milliseconds (4000 = 4 secs)
var msgcount = 5;
var i = 1;
var blank = " ";
function StringArray (n) {
this.length = n;
for (var x = 1; x <= n; x++) {
this[x] = ' ';
   }
}
message = new StringArray(msgcount);
message[1] = "Check out this JavaScript SplashPage!!";
message[2] = "Yet another cool effect using javascript...";
message[3] = "you can easily add this to your web pages.";
message[4] = "Why don't you put it on your site?";
message[5] = "Don't forget, there are still<br>lots more scripts to check out!";
 
function SplashPage() { 
SplashPagepage = '<body bgcolor='+background+'>'
+ '<center><table border=0 '
+ 'height=100%><tr><td><center><b><font '
+ 'color='+text+' size=6>'+message[i]+'</font></b>'
+ '</center></td></tr></table></center><font size=1 color="white">'
+  '<div style="position: absolute; right: 10px; bottom: 10px;" id=copy>Script From Mistonline.in</div></font></body>';
 
if (i == message.length + 1) parent.location = URL;
 
if (i < message.length + 1) { 
frames['SplashPageshow'].location = "javascript:parent.SplashPagepage";
i++;
setTimeout("SplashPage()",speed);
   }
}
// End -->
</script>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<iframe width="100%" height="96%" name="SplashPageshow" src="javascript:parent.blank"></iframe>
<!-- Script Size:  1.68 KB -->
<input type="button" value="Start Splash Page" onclick="SplashPage()"/>
VN:F [1.9.22_1171]
Rating: 6.3/10 (6 votes cast)
Add a splash page using javascript, 6.3 out of 10 based on 6 ratings

Incoming search terms:




coded by nessus

Leave a Reply

  • //27 May 2013

    Great tutorial..!! Its really very useful to know JavaScript splash page creation method. Thanks for sharing.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
Close
Please support the site
By clicking any of these buttons you help our site to get better