Link to home
Start Free TrialLog in
Avatar of MaxOvrdrv2
MaxOvrdrv2

asked on

5 second splash screen with image

Hi,

I would like to know if there is any code available or if anyone knows how to make a Splash Screen type of thing where a window would pop-up, load an image within the new window (or it could be hardcoded on the page that it loads... i don't care) and then closes the window after 5 seconds... or less...

I'm sure there is a way to do this... i need a working response A.S.A.P. and i've given the points to reflect that... hope you guys can help!

Thanks!

MaxOvrdrv2
Avatar of MaxOvrdrv2
MaxOvrdrv2

ASKER

crap.. this should be in the JavaScript section... it's ok.. if anyone can answer.. let me know... in the mean time... i will post another question in JavaScript sections...
Check out if this helps. Copy the below code and make two files 1. Test.html 2. splash.html
Open Test.html in browser.
=====================test.html=========================
<HTML>
     <HEAD><TITLE>TESTING</TITLE>
     <SCRIPT language="javascript">
     <!--
          function openFlash(){
               //Try both the option and use according to your requirement
               //var w = window.open('splash.html','new_win','fullscreen=no,status=no,buttons=no,toolbar=no,location=no,scrollbars=0,resizable=no');
               var w = window.open('splash.html','new_win','fullscreen=yes,status=no,buttons=no,toolbar=no,location=no,scrollbars=0,resizable=no');
               w.resizeTo(400,130);
               var lleft = get_lleft (400);
               var ltop = get_ltop (130);
               w.moveTo(lleft,ltop);
               w.focus();
          }
         
          function get_lleft ( p_width ){
               var l = (screen.availWidth/2)-(p_width/2);
               return l;
          }
     
          function get_ltop ( p_height ){
               var t = (screen.availHeight/2)-(p_height/2);  
               return t;
          }
     //-->
     </SCRIPT>
     </HEAD>
     <BODY onload="javascript:openFlash()">
     </BODY>
</HTML>
     
====================== splash.html =====================

<HTML>
     <HEAD><TITLE>TESTING</TITLE>
     <SCRIPT language="javascript">
     <!--
          function handleOnLoad(){
               window.setTimeout("closeWin()",5000);
          }
         
     
          function closeWin(){
               self.close();
          }
     //-->
     </SCRIPT>
     <STYLE type="text/css">
          <!--
               body{
                    background-color : #D4D0C8;
                    border : thin outset;
               }
               td.frame{
                    background-color : #D4D0C8;
                    border : thin groove;
               }
          //-->
     </STYLE>
     </HEAD>
     <BODY topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 onload="javascript:handleOnLoad()">
          <TABLE>
               <TR>
                    <TD valign="center" align="center">
                         <TABLE width="370px" height="100px">
                              <TR>
                                   <TD class="frame" valign="center" align="center">
                                        <IMG src="https://www.experts-exchange.com/v3.0/images/greyLogo.jpg">
                                   </TD>
                              </TR>
                         </TABLE>
                    </TD>
               </TR>
          </TABLE>
     </BODY>
</HTML>    
ASKER CERTIFIED SOLUTION
Avatar of nimaig
nimaig
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i had it done already from the JavaScript section... but since you put some time and code into this... i'll give you the points... i'm in a good mood today!

Cheers!
Enjoy!
Don't spend em all!

MaxOvrdrv2