Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Page Takes Time Loading

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29954
    Kestral
    Member

    This page here. (Best viewed in Mozilla FireFox, I’ll get to WebKit later. And no, no IE.) is taking an obscene amount of time to load, considering.

    I don’t understand why, before the page loads, there is no loading of images. Images are only loaded after the page fully loads one at a time.

    Here’s the script:

    Code:
    $(function() {

    bgs = new Array(
    ‘ff13’, ‘fonv’,
    ‘crysis2’, ‘batmanac’,
    ‘bioshock’, ‘dragonage’
    );

    $(“.selector”).css(‘background-image’, ‘url(sel/’ + bgs[0] + ‘.jpg)’);
    $(“.supplement[rel=’1′]”).show();

    $(“.control li”).mouseenter(function() {
    rel = $(this).attr(‘rel’);
    if(bgs[rel – 1] == ”) {
    $(this).remove();
    return false;
    }
    $(“.selector”).css(‘background-image’, ‘url(sel/’ + bgs[rel – 1] + ‘.jpg)’);
    $(“.supplement”).hide();
    $(“.supplement[rel='” + rel + “‘]”).show();
    });
    });

    Sel/

    As you can see, it will only load one image once the page is done loading, and it will then load new images whenever an event occurs.

    Is there something I’m missing here?

    Edit:
    Critiquing would also be appreciated.

    #81685
    cybershot
    Participant

    try removing the analytics code at the bottom of the page and see what happens. then remove any scripting to see what happens. keep removing stuff one by one until you find what is slowing down your site. Try adding a regular doctype instead of the html 5 version of it.

    #81694
    noahgelman
    Participant

    Also, after each time clear your cache so you can get accurate time estimates.

    #81708
    Kestral
    Member

    It seems to have been the server that was the culprit. (Blame the host) It loads at a normal pace now.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.