Jump to content

Making an entire block clickable/linked?

Recommended Posts

  • 11 months later...
On 2/4/2021 at 1:59 AM, tuanphan said:

Hi. Which plan do/will you use? We can give the solution.

Hi @tuanphan - first thank you so much - your responses in this forum have saved me soooo much time. You're amazing! 🙌🙏☀️

I have the same question as the person above. The site I'm working on uses the Commerce Advanced plan.

I'd like to make both the button and image of the image card block clickable, but if that's not possible, the entire block clickable.

I'm working on this page, but for now can be accessed through: https://littleyellowdoors.com/test-home 

The block ID for the image card is (it already has code to make it full width):

#block-yui_3_17_2_1_1643528015607_13095

The section ID is: 

section[data-section-id="61f63f6a32982f3789c79655"]

 

Link to comment
On 1/30/2022 at 5:22 PM, StoriesAroundTheSun said:

Hi @tuanphan - first thank you so much - your responses in this forum have saved me soooo much time. You're amazing! 🙌🙏☀️

I have the same question as the person above. The site I'm working on uses the Commerce Advanced plan.

I'd like to make both the button and image of the image card block clickable, but if that's not possible, the entire block clickable.

I'm working on this page, but for now can be accessed through: https://littleyellowdoors.com/test-home 

The block ID for the image card is (it already has code to make it full width):

#block-yui_3_17_2_1_1643528015607_13095

The section ID is: 

section[data-section-id="61f63f6a32982f3789c79655"]

 

You mean make this image + button clickable?

image.thumb.png.beb4c7b7b690c8feaa108aa425ff5ecc.png

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
On 2/4/2022 at 2:23 PM, StoriesAroundTheSun said:

Yes! Sorry for not making that clear. The top section with the photo of the three pieces and the "Shop Now" button. It's a card image block, so it's only allowing the button to be linked. 

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() {
	$("div#block-yui_3_17_2_1_1643528015607_13095").click(function() {
  window.location = $(this).find("a").attr("href"); 
  return false;
});
});
</script>
<style>
  div#block-yui_3_17_2_1_1643528015607_13095:hover {
    cursor: pointer;
}
</style>

 

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
On 2/8/2022 at 3:33 AM, tuanphan said:

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() {
	$("div#block-yui_3_17_2_1_1643528015607_13095").click(function() {
  window.location = $(this).find("a").attr("href"); 
  return false;
});
});
</script>
<style>
  div#block-yui_3_17_2_1_1643528015607_13095:hover {
    cursor: pointer;
}
</style>

 

You are seriously amazing @tuanphan! 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.