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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:40:19+00:00 2026-06-08T19:40:19+00:00

I use Highslide jQuery Gallery to load albums and their thumbnails on a single

  • 0

I use Highslide jQuery Gallery to load albums and their thumbnails on a single page.
Users can click the thumbnail and each album then loads.

The website runs slow if I have more than 10 albums per page (due to loading thumbs and pics)
I use base64 encoding on the data in the database.

How can I load only the thumbails instead of whole albums?
The album will only load once the user has clicked the thumbnail..

<?php 

//vars
$albumsQuery = mysql_query("select * from albums");
$album_count = 0;
// start loop
while ($album = mysql_fetch_array($albumsQuery)) {
    $album_count++;
    $unserializePhotos  = unserialize(base64_decode($album['photos']));
    $unserializeDescriptions = unserialize(base64_decode($album['descriptions']));
    $firstPhoto = '';
    $first_photo_count = 0;
    foreach ($unserializePhotos as $k => $v) {
        if ($first_photo_count == 0) {
            $firstPhoto = $v['name'];
        }
        $first_photo_count++;
    }
    $first_desc_count = 0;
    foreach ($unserializeDescriptions as $k => $v) {
        $unserializeDescriptions[$k]=htmlspecialchars($v);
        if ($first_desc_count == 0) {
            $firstDesc = htmlspecialchars($v);
        }
    $first_desc_count++;
    }
?>

<div class="highslide-gallery">
<a class='highslide' id="thumb<?php echo $album_count; ?>" href='/albums/<?php echo $firstPhoto; ?>' onclick="return hs.expand(this, {slideshowGroup: <?php echo $album_count; ?>})">
    <img src='/albums/<?php echo $firstPhoto; ?>' height="100px" width="100px" />
</a>
<div class="hidden-container">
    <?php 
    $photoDescIndex = 0;
    foreach ($unserializePhotos as $k => $v) {
        if ($v['name'] != '' && $v['name'] != $firstPhoto){
    ?>
        <a class='highslide' href='/albums/<?php echo $v['name']; ?>'  onclick="return hs.expand(this, {slideshowGroup: <?php echo $album_count; ?>})">
            <img src='/albums/<?php echo $v['name']; ?>' />
        </a>
    <?php 
        }
    $photoDescIndex++;
    } 
    ?>
</div>
  • 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-08T19:40:21+00:00Added an answer on June 8, 2026 at 7:40 pm
    1. You are loading full image into thumbnail: <img src='/albums/<?php echo $firstPhoto; ?>' height="100px" width="100px" />. Browser requires more time to load big photo and even more time to resize it. You should prepare small 100×100 thumbnails on the server side.

    2. You should not load all albums <div class="hidden-container">...</div> explicitly. Load content of selected album via AJAX on demand (when user clicked on thumbnail). Additionally you may start to pre-load albums in background after page loading.

    3. Do not assign event handlers directly to each onclick="..." – use event delegation e.g.

      $("body").on("click", ".highslide", function() {
        var album_count = this.id.slice(5); // a id="thumb<?php echo $album_count; ?>"
        var target = $(this).next("div.hidden-container");
        // TODO: load album album_count into target via AJAX
        // TODO: after load: hs.expand(this, {slideshowGroup: album_count});
      });
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a gallery with highslide. I have two thumbnails, a larger
I use Imageflow carousel combined with HighSlide image thumbnail viewer. I joined them together
use Text::Table; my $tb = Text::Table->new(Planet,Radius\nkm,Density\ng/cm^3); $tb->load( [ Mercury,2360,3.7], [ Mercury,2360,3.7], [ Mercury,2360,3.7], );
Use of gradient images is very common among developers for styling a page. Gradient
Use case example: Client A comes to request sales information, enters their zip code
Use case is to have a server connect to thousands of users email accounts
I use this js http://highslide.com . I have a separate div and i want
Can we use an image pattern to fill the bar of highchart barcharts.? In
Use OPENXML to get dt element in MSSQL 2005. How can I get xmlns:dt
use level1\level2\level3; Can someone explain with a simple demo ?

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.