Jump to content

Coding to Time Delay Section 7.1

Recommended Posts

LeadPages and Samcart have an option where you can make the next section of your webpage show up after X number of minutes. This is helpful if say someone has a video on a page, and at the 8th minute of the video, they want the remaining sections on the page to be visible (like a sales page).

Does anyone know if this can be done in Squarespace? I image some modified coding on the parallax setting might achieve this, but I'm hardly savvy enough to know.

Anybody know?

Link to comment
3 hours ago, acrumbine said:

@tuanphan  I've seen you answer something similar. Wondering if you have any insight here...

Thanks!

Aisha

You need to use JavaScript to do this.

<script>
$("div").hide();
setTimeout(function(){
	$("div").show();
},3000);
</script>

Line 1 - We select the div with $(“selector”) and hide the div.

Line 2 - SetTimeout is a function which takes two parameters - i)Function to call,ii)Time delay after which we call that function.

Line 3 - Inside the function we again select the div and call show function on it.

Line 4 - We specify the time delay in ms(milliseconds) , so 3s ~ 3000ms.

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
29 minutes ago, acrumbine said:

@tuanphan Thank you! So if I have a page with two sections, and I want the top section to be visible immediately, and I want the second section to show up in 3 seconds, I'd add this code where exactly? Page Settings > Advanced ? Page Code Injection?

A

 

Add to Page Header. Replace div with section id.

Try this guide.

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 year later...
  • 1 year later...

Hi, can you post and example of this code using an example div? 

Think I'm having a syntax issue. Not sure if I should be including the quotes or not.  For example would this work? 

 

<script>
$("div#block-d8f89965ca0d137117b2").hide();
setTimeout(function(){
    $("div#block-d8f89965ca0d137117b2").show();
},3000);
</script>

 

or would this work? 

<script>
$(div#block-d8f89965ca0d137117b2).hide();
setTimeout(function(){
    $(div#block-d8f89965ca0d137117b2).show();
},3000);
</script>

 

Or do you mean something completely different than either of the above?

 

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.