1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Strange Question] - Need something to slow up my page load

Discussion in 'General Scripting Chat' started by almir, Nov 23, 2012.

  1. almir

    almir Power Member

    Joined:
    Jul 11, 2008
    Messages:
    728
    Likes Received:
    229
    Yep, kinda strange one..

    I need something to slow up complete page load.. it's preferable for all content to be shown but something to prevent page to load 100%.

    I know it's crappy description but hope you know what I mean, lol

    I'm complete moron in anything tech/coding :(
     
  2. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,143
    I don't think adding a delay is a good strategy to your problem. Time to upgrade your hosting ;)

    Otherwise, you could use iptables on Linux to do that - or traffic shaping. For example, this will add a 250ms delay globally.
    Don't mess with it if you have not idea about it - read read read the manual.
     
  3. olystyle

    olystyle Regular Member

    Joined:
    Jan 6, 2012
    Messages:
    238
    Likes Received:
    103
    Maybe Jquery lazyload is what you are looking for... this jquery plugin can be applied to images, tabs,...
    If you are looking for something entirely different could you perhaps specify your use case?

    Cheers
     
  4. Stizerg

    Stizerg Power Member

    Joined:
    Oct 23, 2011
    Messages:
    611
    Likes Received:
    167
    Probably you didn't get the question, he doesn't want onLoad event to trigger. Am I right?
    Try to load big images with javascript, then remove them from memory and load again.

    Can you explain why do you need it?
     
  5. Gogol

    Gogol Elite Member

    Joined:
    Sep 10, 2010
    Messages:
    3,062
    Likes Received:
    2,872
    Gender:
    Male
    use jquery...

    try this ( uneed it on top of the page, or it wil not work correctly. place it just after the head starts)..

    Code:
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script>
    $(document).ready(function(){
       $('#your_main_container_id').css('display', 'none');
    });
    $(window).load(function(){
       $('#your_main_container_id').css('display', 'block');
    });
    </script>
    
    In my personal opinion, you better not do this ;-)
     
  6. sockpuppet

    sockpuppet Junior Member

    Joined:
    Nov 7, 2011
    Messages:
    155
    Likes Received:
    145
    sleep.php
    Code:
    <?php
    header('Content-type: image/png');
    sleep(10);
    ?>
    
    and put an image at the end of your document:
    Code:
    <img style="display:none" src="sleep.php" />