Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7630937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:13:31+00:00 2026-05-31T06:13:31+00:00

Example site: http://johanberntsson.se/dev/fotosida/ Relevant code: jQuery.fn.center = function () { this.css(position,absolute); this.css(top, (($(window).height() –

  • 0

Example site: http://johanberntsson.se/dev/fotosida/

Relevant code:

jQuery.fn.center = function () {

    this.css("position","absolute");
            this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
            this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
            return this;
}


$.each(data, function (index, val) {
    $('<img/>').data({
        exif: val.exif
    }).attr({
        'src': 'fotosida/' + val.full_url + "?" + new Date().getTime(),
        'class': 'mainimages'
    }).css({
        'margin': '10px auto',
        'display': 'block'
    }).hide().appendTo('body');
});

$('#progressbar').center().fadeIn(500);

var i = 1;

$('body img.mainimages').load(function () {
    $("#progressbar").progressbar({
        value: (i / data.length) * 100
    });
    i++;
    if(i > data.length) {
        setTimeout(function () {
            $('#progressbar').fadeOut(500, function () {
                $('body img.mainimages').fadeIn(200);
            });
        }, 200);
    }
});

What I don’t understand is why the loader doesn’t fade in. It just pops up like I was using show()

Any help is appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:13:32+00:00Added an answer on May 31, 2026 at 6:13 am

    I would guess it is because you aren’t creating the progress bar until the first image loads. So, it does fade in, but it is an empty div at that point. Once the first div loads, the progress bar is initialized.

    Try doing this:

    $('#progressbar').progressbar({ value: 0 }).center().fadeIn(500);
    

    As an added note, if you use this as your #progressbar css, you won’t need a special center() function, and the progress bar will remain centered if the window is resized:

    #progressbar {
        display: none;
        width: 900px;
        height: 2em;
        position: absolute;
        margin-left: -450px;
        margin-top: -1em;
        left: 50%;
        top: 50%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used this example to hide and show some divs on my site: http://papermashup.com/simple-jquery-showhide-div/
I am using code from this site: http://www.spacesimulator.net/tut4_3dsloader.html It works in their example project
I looked at this site example: http://www.codesampler.com/dx9src/dx9src_6.htm But the code is rather weird: it
Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
Site: http://na.leagueoflegends.com/ladders/solo-5x5 Search for a a player (example: Jaiybe) You get redirected (in this
i found a worked example at this site http://jsfiddle.net/VNXb2/26/ , but when i put
Recently I've been seeing a lot of this: <a href='http://widget-site-example.com/example.html'> <img src='http://widget-site-example.com/ross.jpg' alt='Ross&#39;s Widget'
the specific example i am referring to is this site http://www.iamextreme.net/category.php?CategoryId=1&SubCategoryId=0&SortBy=name notice the sort
I have a site http://www.example.com/m/controller/function Today I have removed the directory /m/ from all
I've got jQuery Masonry working on my site http://www.lovejungle.com/dev/testenvironment/?cat=4 But for the life of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.