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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:31:34+00:00 2026-06-02T04:31:34+00:00

I’m trying to implement the Lazy Load plugin into my jQueryMobile site to help

  • 0

I’m trying to implement the Lazy Load plugin into my jQueryMobile site to help speed up loadtimes on pages that contain a ton of images.

If I bypass JQM’s ajax page-loading by going directly to the URL like this: http://hello.com/about, the lazy loading works great. However, if I click-through to the About page from another page, which utilizes JQM’s ajax page-loading, Lazy Load doesn’t load.

The About page has an id of about => <div data-role="page" data-theme="a" id="about">

I’ve tried a number of variations of binding to the pageinit function with no success. My latest attempt is:

$('#about').live('pageinit', function() {
    $(window).load(function() {
        $("img.lazy").lazyload();
    });
});

Any guidance on this would be awesome. Thanks guys.

  • 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-06-02T04:31:35+00:00Added an answer on June 2, 2026 at 4:31 am

    The window.load function will fire only once, and you are binding to it after it fires when pages are pulled into the DOM via AJAX. The solution to your issue is pretty easy, run the code when the specific page initializes:

    $(document).delegate('#about', 'pageinit', function() {
    
        //notice I start the selection with the current page,
        //this way you only run the code on images on this pseudo-page
        $(this).find("img.lazy").lazyload();
    });
    

    This should work just fine since pageinit won’t fire until after document.ready fires.

    Also notice I used .delegate() instead of .live() since .live() has been depreciated and could be removed from future releases.

    $(SELECTION).live(EVENT, EVENT-HANDLER);
    

    is the same as:

    $(document).delegate(SELECTION, EVENT, EVENT-HANDLER);
    

    And for the bonus round, as of jQuery 1.7, both of the above functions actually map to .on() and you can use .on() in a delegated manor like so:

    $(document).on(EVENT, SELECTION, EVENT-HANDLER);
    

    Documentation:

    • .live(): http://api.jquery.com/live
    • .delegate(): http://api.jquery.com/delegate
    • .on(): http://api.jquery.com/on

    The reason your code worked on the first page-view was because the window.load event was firing after you bound to it in the pageinit event handler, but on subsequent AJAX loads you are binding to the window.load event even though it won’t fire anymore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.