Jump to content

Infinite scrolling in a gallery? (Pacific 7.0)

Recommended Posts

Site URL: https://dawidbania.com/

Hello!

I was wondering if it is possible to make my galleries load faster?
Little background: I work as a photographer and I deliver between 400 and 600 photographs to my clients, sometimes with gifs included. The final size of the such galleries, despite using very effective compression methods, exceeds 50 megabytes. Sometimes it's over 80. I would really love to keep my galleries on Squarespace, but it's just getting really innefficient doing it this way. 

My question is: Is there any way, for example, to change the code so that only the content that should be visible is being loaded for the viewer (like infinite scrolling), and the rest of the content gets downloaded as the viewer scrolls down? Maybe it can decrease loading times and make the visit on the website smoother. Or any other method that could work? Here's an example of a troublesome gallery (especially on the phone): https://dawidbania.com/joanna-wojciech-weddingday

I'd be extremely grateful for help within this matter. I don't know how to make it work.
 

Edited by dbania
Link to comment
  • dbania changed the title to Infinite scrolling in a gallery? (Pacific 7.0)
1 hour ago, dbania said:

Site URL: https://dawidbania.com/

Hello!

I was wondering if it is possible to make my galleries load faster?
Little background: I work as a photographer and I deliver between 400 and 600 photographs to my clients, sometimes with gifs included. The final size of the such galleries, despite using very effective compression methods, exceeds 50 megabytes. Sometimes it's over 80. I would really love to keep my galleries on Squarespace, but it's just getting really innefficient doing it this way. 

My question is: Is there any way, for example, to change the code so that only the content that should be visible is being loaded for the viewer (like infinite scrolling), and the rest of the content gets downloaded as the viewer scrolls down? Maybe it can decrease loading times and make the visit on the website smoother. Or any other method that could work? Here's an example of a troublesome gallery (especially on the phone): https://dawidbania.com/joanna-wojciech-weddingday

I'd be extremely grateful for help within this matter. I don't know how to make it work.
 

Squarespace provides a method to access the page content via ajax and return as JSON definition

View JSON Data — Squarespace Developers

In your case the url is https://dawidbania.com/joanna-wojciech-weddingday?format=json-pretty, it actually reduce the initial page size to around 21KB (since it purely text).

With this technique you can call the page's json data on another page and process inifinite scrolling there, so far there is no specfic solution but that how I did for other client project

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
  • 1 month later...
On 7/4/2021 at 2:43 AM, bangank36 said:

Squarespace provides a method to access the page content via ajax and return as JSON definition

View JSON Data — Squarespace Developers

In your case the url is https://dawidbania.com/joanna-wojciech-weddingday?format=json-pretty, it actually reduce the initial page size to around 21KB (since it purely text).

With this technique you can call the page's json data on another page and process inifinite scrolling there, so far there is no specfic solution but that how I did for other client project

Thank you for your response. Unfortunately, I need to keep the images visible, not turned into text containing their file names... 🙂

Link to comment
1 hour ago, dbania said:

Thank you for your response. Unfortunately, I need to keep the images visible, not turned into text containing their file names... 🙂

It's the text contains the image url already, you can use javascript to parse it into html content, I did not mean to append these text into the gallery directly

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
8 hours ago, bangank36 said:

It's the text contains the image url already, you can use javascript to parse it into html content, I did not mean to append these text into the gallery directly

Thank you, Bangank36. Is there a specific code I may use to make it happen? I'm a complete newbie when it comes to this kind of solutions...

Link to comment
10 hours ago, dbania said:

Thank you, Bangank36. Is there a specific code I may use to make it happen? I'm a complete newbie when it comes to this kind of solutions...

You may find Universal Filter plugin to try it out 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.