How to display preloader only once?

Hi, i’ve implemented a preloader (home page only) which works fine, but I would like it to be displayed only once a session, i.e. if the user goes from home page to another page and returns to home page, the preloader will not be displayed again.
The preloader is set for mobile only.

I’ve tried to implement @samliew solution: Cookie Consent - Modal wrapper but just on the first load possible?, but unfortunately it’s not working for me, and I also get many errors in the console.

Can anyone help me with this?

This is my preview link: https://preview.webflow.com/preview/gilad-armon?utm_medium=preview_link&utm_source=designer&utm_content=gilad-armon&preview=0300581809086ef853b83c201ca07e05&pageId=5cb442b937cbae81350b347e&mode=preview

and this is the live website: https://www.alwaysforward.co.il/

Thank you,
Naama.

1 Like

Hey @Naama

@Finsweet Has a cool video with a trick you can try. See here > https://www.youtube.com/watch?v=mFbk1O_8Nio

Piter :webflow_heart:

5 Likes

Thank you so much @PeterDimitrov and off course @Finsweet for solving this issue!!!

3 Likes

Great video. Thanks!

3 Likes

I see it working! Looks great. Thank you for subscribing :slight_smile:

4 Likes

@Finsweet and @PeterDimitrov, another question please - after the pre-loader finishes, a slider starts playing, but I don’t know how to delay the first slide, it’s displayed briefly and moves to the second slide.
Do you have any idea?

Thank you,
Naama.

@Naama This would be a really nice F’in sweet Webflow Hack.

We built something somewhat similar with Webflow tabs component for Streak. Features | Streak - CRM for Gmail. The tabs turn into an autoplay slider and only start their autoplay when the user scrolls to to that tab component. The same mentality can go into the “Delay slider”

I’m going to add this to our Hacks queue. I’m guessing you’ll want the slider to begin when the user scrolls to the slider? Anything else I should add in the specs?

4 Likes

Hi @Finsweet, thank you so much for this! I wish the slider to begin when the slider comes back to focus, since the slider is autoplaying, no need for the user to scroll it.

important to other users. @Finsweet code solution could solve any issue related to “Show only once” (Show modal/popup only once. Show terms only once. Do X only once and so on…).

Related:

Basic use:
https://github.com/js-cookie/js-cookie#basic-usage

Set:

Cookies.set('name', 'value');
/*Create an expiring cookie, valid to the path of the current page:
*/
Cookies.set('name', 'value', { expires: 7, path: '' });

Get:

Cookies.get('name'); // => 'value'
Cookies.get('nothing'); // => undefined

Show cookies under Chrome inspector:

right clickinspect (Or ctr+shift+I) → Application Tab

Cockies Basic guide

1 Like

Hi @Finsweet sorry for bothering you with this, perhaps you can help me:
the page wrapper contains a slider in the hero section. On the first time the pre-loader is working and then the page wrapper is displayed, only the the first slide is displayed. When refreshing, whole the slider is displayed.

this is the preview link: https://preview.webflow.com/preview/hollestudio-copy?utm_medium=preview_link&utm_source=designer&utm_content=hollestudio-copy&preview=0e50fda467bb89214a6fd6ac8ef15634&mode=preview

and the live website: https://hollestudio-copy.webflow.io/

I would really appreciate your help.
Thank you,
Naama.

Hey @Naama , been trying to do the same thing on my page, but can’t seem to get it to work, mind taking a look? Thx!

https://spicy-spouse-podcast.webflow.io/new?46a959ec_page=2

https://preview.webflow.com/preview/spicy-spouse-podcast?utm_medium=preview_link&utm_source=designer&utm_content=spicy-spouse-podcast&preview=67c78a492cd600dd090945deba9bae2e&pageId=5d2a83339ea87f0b7e099b66&mode=preview

Hi @zellet, 2 things I see:

  1. preloader - should be displayed: flex and not hidden
  2. the interaction should play when page loads, not when finished loading

does it help?

Naama.

It was hidden so i could continue working on the site. The issue I’m having is the cookie thing, it wants to load when anything on the page needs to load. See here:
https://spicy-spouse-podcast.webflow.io/new?46a959ec_page=1

Hey @zellet, sorry but I don’t undesrstand the problem. This is what I get when entering the URL you sent:

Hey @Naama, just saw this. This is weird behavior. I took a look and I’m not sure why this is happening.

Is there a reason there is an ix1 legacy interaction called “New Interaction” on the the slider element?

Cool preloader by the way

Hi @Finsweet, i’ve removed the ix1 interaction now, it was something left from my testings.
I actually solved the problem by adding a page refresh after the pre-loader is done. It’s not elegant, but solved the problem. You can see it here: https://www.hollestudio.co.il/

Thank you,
Naama.

1 Like

Hi @Finsweet … Thanks for the hack! I desperately needed a solution but however… in spite of trying and tweaking your code for many hours I am unable to make it work.

Linking onto @zellet issue i.e unable to create or retrieve cookies. Any advice on where I am going wrong?

NOTE: I deleted the script since it was not relevant to mine but I dont think that is the problem; anyways awaiting help from experts (:thinking:)

Some additional info:

  • I published and reviewed my site across many devices

  • I cleared any webflow or my domain related cookies/cache before I published with the script.

script works amazing, but can’t find the solution to achieve this…

on Initial page visit/load

loader-animation starts [contains elements from loader-wrapper]
loader-animation stops
page-animation starts [loading background, menu’s = elements from page-wrapper]

on second load / refresh

directly starts page-animation [loading background, menu’s and content from page-wrapper]

been struggling for hours trying all sorts of combinations, multiple page load animations, scroll into view triggers, removing the timer part, etc etc… but no luck so far. Either the initial load skips the page-animation, or the second load has a white delay before the page-animation…

any Ideas?

I’m using this trick and it breaks my home page inside the Webflow Editor any ideas @Finsweet ?

https://preview.webflow.com/preview/wsa-final?utm_medium=preview_link&utm_source=dashboard&utm_content=wsa-final&preview=770ed898bcc44ffb8a41991a0ccdef5f&workflow=preview