Jump to content

Swipeable section with linked items?

Recommended Posts

I wan't a section of items to be linked without showing the buttons beneath. For that I use a script to hide the buttons and place the link directly on the item instead:

/* Remove buttons and make images clickable instead TEST */
[data-section-id="6541f9df4bbcfc6d6e699dca"] li.list-item {
    position: relative;
}
[data-section-id="6541f9df4bbcfc6d6e699dca"] .list-item-content__button-container {
    position: static;
}
[data-section-id="6541f9df4bbcfc6d6e699dca"] a.list-item-content__button.sqs-block-button-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    color: transparent !important;
    background-color: transparent !important;
    border: none !important;
}

It works fine, but the problem is that it disables the swipeability of the section for some reason.

If you look at https://www.getvibes.se/test you can see that the top row of items (with the script added to it) is not swipeable anymore. The bottom row without the script is swipeable.

Anyone got a clue?

Link to comment
  • Replies 4
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

The two functions oppose each other; by making the button cover the entire item, you are covering up the "handle" that allows you to swipe, the touch becomes part of the button press.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
18 minutes ago, Uggel said:

Any possibility to keep both swipe & button press?

You could probably reduce the clickable area to the bottom half? I'm not sure how good a user experience this would make though, could be confusing.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

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.