Results 1 to 5 of 5

Thread: javascript open while loading

  1. #1
    xxtoni's Avatar
    xxtoni is offline xxtoni
    Join Date
    Jan 2010
    Posts
    353
    Thanks
    16
    Thanked 42 Times in 34 Posts

    javascript open while loading

    Greetings

    I need a bit of help with a page I am making.I want it to work like this:
    while a flash file loads in the background a shadowbox overlayer should open as soon as you enter the page.
    I tried

    window.onload = function() {

    But it only loads the file AFTER flash finished loading.So my question is how do i make javascript load a file while the page is loading in the background.
    Hope someone can help me

    Kind Regards
    Antony

  2. #2
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,329 Times in 1,259 Posts
    You can cause onLoad to call two functions by separating them with a semicolon:
    Code:
    <window onLoad="function('arg'); function('arg')">
    Or, what about moving the shadowbox overlayer to a body OnLoad statement?
    Code:
    <body onLoad="function('arg')">
    Or, what about writing an init function?
    Code:
    <script type="text/javascript">
    function init()
    {
    function('arg');
    function('arg');
    }
    //-->
    </script>
    You can then call your init function in body:
    Code:
    <body onLoad="init()">
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  3. Thanked by:

    xxtoni (22 April, 2010)

  4. #3
    xxtoni's Avatar
    xxtoni is offline xxtoni
    Join Date
    Jan 2010
    Posts
    353
    Thanks
    16
    Thanked 42 Times in 34 Posts
    First of all I want to thank you for your reply.I hope this doesent sound too iritating but how do i apply these ?

    At the moment this is the code I use:

    Code:
    Shadowbox.init({
        skipSetup: true
    });
    
    window.onload = function() {
    
        // open a welcome message as soon as the window loads
        Shadowbox.open({
    		player:     "iframe",
    	    content:    'script/index.html',		   
        });
    
    };

  5. #4
    anantshri is offline on leave from Net Builders : will post rarely
    Join Date
    Apr 2010
    Location
    india
    Posts
    338
    Thanks
    80
    Thanked 47 Times in 40 Posts
    just an alternate suggestion

    try loading flash throught documentation - swfobject - Embedding Adobe Flash Player content using SWFObject 2 - Project Hosting on Google Code

    and in that case you can very well use javascript to control both stuff simultaneously.

    hope this helps

  6. #5
    xxtoni's Avatar
    xxtoni is offline xxtoni
    Join Date
    Jan 2010
    Posts
    353
    Thanks
    16
    Thanked 42 Times in 34 Posts
    Quote Originally Posted by anantshri View Post
    just an alternate suggestion

    try loading flash throught documentation - swfobject - Embedding Adobe Flash Player content using SWFObject 2 - Project Hosting on Google Code

    and in that case you can very well use javascript to control both stuff simultaneously.

    hope this helps
    Thanks
    I hope this works

Similar Threads

  1. Are PPC slowing your loading time?
    By Franc Tireur in forum PPC
    Replies: 3
    Last Post: 28 February, 2012, 11:43 AM
  2. 14 Rules for Faster-Loading Web Sites
    By sturat in forum Building
    Replies: 6
    Last Post: 10 November, 2009, 20:44 PM
  3. Problem: Site not loading
    By sadekjake in forum Web Proxies
    Replies: 3
    Last Post: 18 September, 2009, 07:48 AM
  4. Reduce the loading time of a web page
    By Brandon in forum Web Design
    Replies: 6
    Last Post: 29 May, 2009, 18:17 PM
  5. loading style sheets
    By epidemic in forum Programming
    Replies: 8
    Last Post: 4 May, 2009, 05:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •