SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: loading..

  1. #1
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    loading..

    I've got a few jquery scripts on my website, with a few that take a while to load.

    How can I add a message in the corner of the website saying "Loading" when it is processing the page?

  2. #2
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    You can put all your normal page content in a separate wrapper div in the <body> and the loading notification in a separate "loading" div also in the <body>.

    By default, hide the wrapper div in the css and only display the "loading" div. Then in your window.onload event handler, using DOM methods hide or remove the "loading" div and unhide (display) the wrapper div.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello. You have misunderstood me. Let me explain in more detail.

    I have a website that displays all my blog posts. On this website I have an infinite scrolling script, where when the user scrolls down it will display more results. It takes around 2 seconds for it process the next set of results therefore I would like it display a spinner or "loading..." at the corner of the page while it is being processed. I would also like to add the "loading..." message to other requests so I'm looking for a global solution.

  4. #4
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Jaynesh View Post
    I've got a few jquery scripts on my website, with a few that take a while to load.

    How can I add a message in the corner of the website saying "Loading" when it is processing the page?
    It appears you are making this up as you go along because the above is all you said in your op and "processing the page" usually means while the page is loading. In any case, your options are linked to some extent to what
    It takes around 2 seconds for it process the next set of results
    means and exactly how the results are being "processed".


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
  •