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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:02:42+00:00 2026-05-24T10:02:42+00:00

Ok, so I have a script to fetched images from Google’s Picasa image service

  • 0

Ok, so I have a script to fetched images from Google’s Picasa image service via JSON. But what I wish is to display say 40 images per page. So if user has more then 40 lets say 80 for example then a pagination would be attached and ones clicked the next 40 images would be shown. If there is a way to do this with jQuery could some one tell me how? Here is the current code for grabbing images via JSON from Picasa

$(document).ready(function() {
         $.getJSON("http://picasaweb.google.com/data/feed/base/user/--USERNAME--/?kind=photo&access=public&alt=json&callback=?",

         function(data) {
                var target = "#picasaweb-images"; // Where is it going?
                for (i = 0; i <= 1000; i = i + 1) { // Loop through the 1000 most recent, [0-9]
                    var pic = data.feed.entry[i].media$group;
                    var liNumber = i + 1; // Add class to each LI (1-10)
                    var thumbSize = 2; // Size of thumbnail - 0=small 1=medium 2=large
                    $(target).append("<ul class='gallery'><li  class='no-" + liNumber + "'><a title='" + pic.media$description.$t + "' rel='qpLightbox' href='getPhoto.jsp?o=" + pic.media$content[0].url + "' onClick=return false;><span></span><img src='getThumb.jsp?wl=4&w=170&h=120&url=" + pic.media$thumbnail[thumbSize].url + "' class='oi'/></a></li></ul>");
                }
        });
        });
  • 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-24T10:02:43+00:00Added an answer on May 24, 2026 at 10:02 am

    Ok so first things first – your <li> elements will have unique classes, which to me seems like the id attribute would be a better fit. Also, I’m not really sure why you’re giving each image it’s own unordered list, with only one list item, but if that’s really what you’re going for, go nuts.

    I’ve never dealt with a pagination plug-in before, but if you want a new ‘page’ every 40 images, I would do something like this:

    var curPage = 0;
    for( i=0; i < 1000; i++ ) {
      if( i/40 + 1 ) > curPage ) {
        if( curPage === 0 ) {
          $('#picasaweb-images').append('<div class="pic_page" id="pic_page_' + (++curPage) + '"></div>');
        } else {
          $('#pic_page_' + curPage).after('<div class="pic_page" id="pic_page_' + (++curPage) + '"></div>');
        }
      }
      $('#pic_page_' + curPage).append(... picture stuff goes here ...);
    }
    

    Style your ‘pic_page’ class however you like, and make sure to add the following:

    .pic_page {
      display: none;
    }
    
    #pic_page_1 {
      display: block;
    }
    

    This will hide all pages of pictures except the first page, to begin with.

    Create some kind of simple navigation scheme:

    <img src='arrow-left.png' id='prev_page_arrow' />
    <!-- it's either a hidden input field, or a global JS var. Pick your poison -->
    <input type='hidden' id='current_page' value='1' />
    <img src='arrow-right.png' id='next_page_arrow' />
    

    And use jQuery to put it all together:

    $('#prev_page_arrow').click( function() {
      var curPage = parseInt($('#current_page').val(), 10);
      $('#current_page').val(curPage-1);
      $('#pic_page_' + curPage).fadeOut(400, function() {
        $('#pic_page_' + (--curPage)).fadeIn(400);
      });
    });
    

    Obviously you’ll want to check for things like page 0, and add something to deal with a max page number, but I think this should get you headed in the right direction.

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

Sidebar

Related Questions

I have a PHP script that fetches an image from a remote server so
I have fetched json through <script> function getjs() { var script =document.createElement(script); script.setAttribute(type,text/javascript); script.setAttribute(src,http://localhost:8080/vigs/f4json?user=3&callback=gr);
I have an array of objects which was fetched from a JSON (JSONP) file
I have a Python script that for-loops through some objects and fetches data from
I have script which allows to display Bing search results. I can call for
I have a script that will fetch data from server and compose a DIV
I have a script that does images resizing on load: $( document ).ready( function()
The script I used fetched a file from https://www.dropbox.com/browse_plain/ $REMOTEDIR?no_js=true which now returns: HTTP/1.1
I'm trying to cache JSON content generated by a php script from database. However
I have a little PyObjC script to change desktop images to a particular file

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.