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 6388711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:18:45+00:00 2026-05-25T03:18:45+00:00

// After a page turn after: function(opts) { var currPageIndex = opts.curr – 1;

  • 0
            // After a page turn
            after: function(opts) {

                var currPageIndex = opts.curr - 1;

                generatePage(currPageIndex);            // This page
                generatePage(currPageIndex + 1);        // Right side page
                generatePage(currPageIndex + 2);
                generatePage(currPageIndex + 3);
            } 
        });
    });

    // Generates the page
    function generatePage(pageID){               

        // Check not already loaded
        if(pageID >= 0 && pageID < arrPages.length && !arrPages[pageID][2])
        {
            arrPages[pageID][2] = true;
            $('#page' + pageID).html('<img src="<%=strProjectPath%>/pages/originals/' + arrPages[pageID][1] + '" alt="Page image" />');
        }
    }

    // Load first page
    $(document).ready(function() {
        generatePage(0);
        generatePage(1);
        generatePage(2);
    });

As you can see, when the document is ready, page 0, 1 and 2 are generated. 0 is the immediately viewable image, then 1 and 2 are preloaded for when they turn the page.

When they turn the page, it loads the current two pages they are viewing (incase the skipped there directly and they aren’t preloaded) and the next 2 pages.

How can you bias the loading, so it loads the immediately viewable pages first? Can you use Jquery onload to queue the next pages? At the moment 4 pages could theoretically all load their images simultaneously which would be slow on mobiles.

  • 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-25T03:18:46+00:00Added an answer on May 25, 2026 at 3:18 am

    Sure, you can use the jQuery load(), but then you shouldn’t add all the images immediately. You could, for example, queue them up like this:

    var preload = function (pageID, rest) {
        $('#page' + pageID).append(
            $('<img/>', {
                src: "<%=strProjectPath%>/pages/originals/' + arrPages[pageID][1] + '"
            }).load(function () {
                rest.length && preload(rest[0], rest.splice(1));
            })
        );
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this weird behaviour of a page. The page loads, but after a
I've got a page that displays something like this: Who's turn is it? Jake
I want to show a loading image after page submit. I want it to
Is it possible to get the mouse position with JavaScript after page loads without
I am using nivo jquery image slider in my asp.net application, but after page
I would like to make one of the div's hidden while rendring. After page
After my page loads my text disappears and I am having trouble determining why.
I want show an information page after success db opartions. And after the info
Im trying to reload a page after the response from the facebook api. With
I would like to refresh a page after it got back into the focus.

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.