Jump to content

How do I disable a 'click-through' on a hover picture?

Recommended Posts

  • Replies 8
  • Views 1.1k
  • Created
  • Last Reply
22 minutes ago, Tinxy7 said:

Site URL: https://dogfish-clarinet-npzm.squarespace.com

I have a 2nd image hover on my home page on some images, but when you click on it it's taking people to a page with the image on - I don't want there to be a click option how do I get rid of this please?!

 

password for site is - empulse2020

Add this in code injection header for disable click

<script>
	jQuery(document).ready(function($) {
    	$('section[data-section-id="5fa54cf09c6d8029943d91c9"] .span-2 a').click(function(e) {
            e.preventDefault();
            //do other stuff when a click happens
        });
    });
</script>

Also add this css to make sure the round button display well on mobile

@media screen and (max-width: 767px) {
  section[data-section-id="5fa54cf09c6d8029943d91c9"] .span-2 {
    width: 33.33% !important;
    float: left !important;
  }
}

image.thumb.png.2eb228d7c800e74fd8a9ec5a254f7a84.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Awe

On 12/17/2020 at 10:13 AM, bangank36 said:

Add this in code injection header for disable click


<script>
	jQuery(document).ready(function($) {
    	$('section[data-section-id="5fa54cf09c6d8029943d91c9"] .span-2 a').click(function(e) {
            e.preventDefault();
            //do other stuff when a click happens
        });
    });
</script>

Also add this css to make sure the round button display well on mobile


@media screen and (max-width: 767px) {
  section[data-section-id="5fa54cf09c6d8029943d91c9"] .span-2 {
    width: 33.33% !important;
    float: left !important;
  }
}

image.thumb.png.2eb228d7c800e74fd8a9ec5a254f7a84.png

Awesome thank you SOOOOOO much!!  🙂

Link to comment
On 12/17/2020 at 10:13 AM, bangank36 said:

Add this in code injection header for disable click


<script>
	jQuery(document).ready(function($) {
    	$('section[data-section-id="5fa54cf09c6d8029943d91c9"] .span-2 a').click(function(e) {
            e.preventDefault();
            //do other stuff when a click happens
        });
    });
</script>

Also add this css to make sure the round button display well on mobile


@media screen and (max-width: 767px) {
  section[data-section-id="5fa54cf09c6d8029943d91c9"] .span-2 {
    width: 33.33% !important;
    float: left !important;
  }
}

image.thumb.png.2eb228d7c800e74fd8a9ec5a254f7a84.png

This actually looks a bit odd on mobile, is there a way of making them larger or so they are in a line somehow please??  Sorry!!

Link to comment
1 hour ago, Tinxy7 said:

This actually looks a bit odd on mobile, is there a way of making them larger or so they are in a line somehow please??  Sorry!!

Add the css code i provided above to design custom css

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
10 hours ago, Tinxy7 said:

Yes I did do that, but they come up quite small and in a line to the side on mobile and look a bit odd?  Lol!

@media screen and (max-width: 767px) {
  section[data-section-id="5fdc89f5adf98e633069baa7"] .span-2 {
    width: 33.33% !important;
    float: left !important;
  }
}

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
  • 2 weeks later...

@Tinxy7 I see on this page on tablet, content is a bit narrow. You can add this CSS to increase width.

https://dogfish-clarinet-npzm.squarespace.com/communications-channels

/* Communications channels */
@media screen and (max-width:991px) and (min-width:768px) {
div#page-section-5fbfdcdfa97599144efcce7a .span-9 {
    width: 90%;
}
div#page-section-5fbfdcdfa97599144efcce7a .span-6 {
    width: 100%;
}
}

contentnarrow.png.d872fa3dbade60b5179d03305f3667ef.png

Also some pages on your site have very long content. You should consider adding a back to top button (You can use this free code to add one).

On FAQs page, you can change all to Accordion. That means when you click on a question, the content will appear below. You click on the next question, the above content will pile up and new content will open. You can use this free code or Accordion Plugin.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.