Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
Liquid/Shopify - How do I check if a div is out of view?

I'm trying to make a sticky add-to-cart button for my Shopify store without the use of any apps. I have done this so far by duplicating the current add-to-cart button and tweaking the CSS for the second button so it's displayed at the bottom of my product page on top of all other elements. The only problem remaining is that both buttons are showing at the same time.

Right now I want to write an if-statement to handle which of the 2 buttons to show on the page based on if the default add-to-cart button is in or out of view for the user (so if the user has scrolled down past the button). Preferably I'd like a boolean to check weather the first button is in view so I can write an if/else statement to decide which button should be loaded but I'm not finding any solution for Liquid/Shopify coding. Any tips on achieving this?

I'm okay using JavaScript but having trouble implementing it with the Liquid code for my product page.

I'm using the Prestige theme.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!