Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How we can give Splash Screen Effects in our Web Application.

Author: DevASP
Download Source Code : 628_WebApplication1.zip

This article is about how you can give splash screen effects in your web application. While developing the desktop application you can do this easily but in your web application it need some work to d

Steps you will do.

 

Start visual studio and create a new web application.Open the HTML code of your web page and add the following HTML code which has JavaScript functions to make the splash screen for your web application. Note that you can also edit the text which is displayed in splash screen and the URL which is to be open after the splash screen is complete. You can also show images in your splash screen as add in this article.

 

 

<html>

            <head>

                        <title>Intro Screen...</title>

            </head>

           

<body bgcolor="#000000" text="#FFFFFF">

 

<div id="splashcontainer" style="position:absolute;width:350px;"></div>

<layer id="splashcontainerns" width="450"></layer>

 

<script>

 

 

var preloadimages=new Array("sun.gif"," sun.gif")

var intervals=2000

var targetdestination="http://www.devasp.com"

var splashmessage=new Array()

var openingtags='<font face="Arial" size="4">'

 

splashmessage[0]='<img src=" sun.gif"> Welcome to devasp <img src=" sun.gif">'

 

splashmessage[1]='You will find here hell of code, articles and solution of your problems'

 

splashmessage[2]='All about Microsoft Technology'

 

splashmessage[3]='Contact us for your web problem solution'

 

splashmessage[4]='We are always here to provide you the better solution'

 

splashmessage[5]='Please stand by...'

 

var closingtags='</font>'

var i=0

var ns4=document.layers?1:0

var ie4=document.all?1:0

var ns6=document.getElementById&&!document.all?1:0

var theimages=new Array()

if (document.images){

for (p=0;p<preloadimages.length;p++){

theimages[p]=new Image()

theimages[p].src=preloadimages[p]

}

}

 

function displaysplash(){

if (i<splashmessage.length){

sc_cross.style.visibility="hidden"

sc_cross.innerHTML='<b><center>'+openingtags+splashmessage[i]+closingtags+'</center></b>'

sc_cross.style.left=ns6?parseInt(window.pageXOffset)+parseInt(window.innerWidth)/2-parseInt(sc_cross.style.width)/2 : document.body.scrollLeft+document.body.clientWidth/2-parseInt(sc_cross.style.width)/2

sc_cross.style.top=ns6?parseInt(window.pageYOffset)+parseInt(window.innerHeight)/2-sc_cross.offsetHeight/2 : document.body.scrollTop+document.body.clientHeight/2-sc_cross.offsetHeight/2

sc_cross.style.visibility="visible"

i++

}

else{

window.location=targetdestination

return

}

setTimeout("displaysplash()",intervals)

}

 

function displaysplash_ns(){

if (i<splashmessage.length){

sc_ns.visibility="hide"

sc_ns.document.write('<b>'+openingtags+splashmessage[i]+closingtags+'</b>')

sc_ns.document.close()

 

sc_ns.left=pageXOffset+window.innerWidth/2-sc_ns.document.width/2

sc_ns.top=pageYOffset+window.innerHeight/2-sc_ns.document.height/2

 

sc_ns.visibility="show"

i++

}

else{

window.location=targetdestination

return

}

setTimeout("displaysplash_ns()",intervals)

}

 

 

 

function positionsplashcontainer(){

if (ie4||ns6){

sc_cross=ns6?document.getElementById("splashcontainer"):document.all.splashcontainer

displaysplash()

}

else if (ns4){

sc_ns=document.splashcontainerns

sc_ns.visibility="show"

displaysplash_ns()

}

else

window.location=targetdestination

}

window.onload=positionsplashcontainer

 

</script>

</body>

</html> 

 

 

Run your application and see the splash effects in your web application.

Article Comments
thanks

Posted on 7/11/2008 7:22:55 AM by dinesh

Start visual studio and create a new web application.Open the HTML code of your web page and add the following HTML code which has JavaScript functions to make the splash screen for your web application. Note that you can also edit the text which is displayed in splash screen and the URL which is to be open after the splash screen is complete. You can also show images in your splash screen as add in this article.

Posted on 11/6/2008 8:56:07 AM by

thanks for u r help can u tell me any other intresting thing about asp.net and how we do this

Posted on 1/28/2010 12:22:44 AM by thanks

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Synchronous Writing and Reading to files using win32 system services.

Disclaimer - Privacy
© 2002-2017 DevASP.net