Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Index: how to disable links yet keep image hover?

Index: how to disable links yet keep image hover?

Scheduled Pinned Locked Moved General Discussion
8 Posts 3 Posters 233 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vthevoz
    wrote on Oct 20, 2022, 6:57 AM last edited by
    #1

    Hello!

    I'm looking for a way (or CSS line) to be able to deactivate index project clicks, yet keep the img hover functionnality.

    The "pointer-events: none;" unfortunately disables the image hover and only shows the list.

    Rather than having specific projects that are not clickable for reasons of confidentiality, I will have normal visible images hovering on public projects and blurred images on private projects, but would still like to have the project names displayed, as it includes important clients.

    Would anybody have the trick or CSS I'm looking for?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arminunruh
      Global Moderator
      wrote on Oct 20, 2022, 10:10 AM last edited by arminunruh Oct 20, 2022, 6:13 AM
      #2

      javascript.

      in lay options → custom head content

      <script>
      jQuery(document).on('.projectindex-project-slug-elementgrid-3 a', 'click', function(e)){
      e.preventDefault();
      e.stopPropagation();
      return;
      });
      </script>
      

      css

      .projectindex-project-slug-elementgrid-3 a{
      cursor: default;
      }
      

      replace "projectindex-project-slug-elementgrid-3" with your correct slug

      in chrome, right click the project index link, choose inspect element.
      find the correct slug for the link:
      Screenshot 2022-10-20 at 12.13.17.png

      J 1 Reply Last reply Mar 19, 2023, 11:11 AM
      0
      • A arminunruh
        Oct 20, 2022, 10:10 AM

        javascript.

        in lay options → custom head content

        <script>
        jQuery(document).on('.projectindex-project-slug-elementgrid-3 a', 'click', function(e)){
        e.preventDefault();
        e.stopPropagation();
        return;
        });
        </script>
        

        css

        .projectindex-project-slug-elementgrid-3 a{
        cursor: default;
        }
        

        replace "projectindex-project-slug-elementgrid-3" with your correct slug

        in chrome, right click the project index link, choose inspect element.
        find the correct slug for the link:
        Screenshot 2022-10-20 at 12.13.17.png

        J Offline
        J Offline
        jenswindolf
        wrote on Mar 19, 2023, 11:11 AM last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • A arminunruh referenced this topic on Apr 26, 2023, 3:13 PM
        • V Offline
          V Offline
          vthevoz
          wrote on Jun 4, 2023, 3:39 PM last edited by
          #4

          @arminunruh said in Index: how to disable links yet keep image hover?:

          <script>
          jQuery(document).on('.projectindex-project-slug-elementgrid-3 a', 'click', function(e)){
          e.preventDefault();
          e.stopPropagation();
          return;
          });
          </script>

          Hey! Unfortunately this doesn't seem to work anymore :'( the image hover works, but the stopPropagation doesn't seem to trigger down, as the chosen project is still clickable. Any workaround (I'm not javascript proficient enough...)?

          V 1 Reply Last reply Jun 4, 2023, 4:26 PM
          0
          • V vthevoz
            Jun 4, 2023, 3:39 PM

            @arminunruh said in Index: how to disable links yet keep image hover?:

            <script>
            jQuery(document).on('.projectindex-project-slug-elementgrid-3 a', 'click', function(e)){
            e.preventDefault();
            e.stopPropagation();
            return;
            });
            </script>

            Hey! Unfortunately this doesn't seem to work anymore :'( the image hover works, but the stopPropagation doesn't seem to trigger down, as the chosen project is still clickable. Any workaround (I'm not javascript proficient enough...)?

            V Offline
            V Offline
            vthevoz
            wrote on Jun 4, 2023, 4:26 PM last edited by
            #5

            @arminunruh

            I've added the following:

            .projectindex-project-slug-example a:active {
            cursor: default;
            }

            .projectindex-project-slug-example a:hover {
            cursor: default;
            pointer-events:none;
            }

            It kinda works, but the hovering images now flicker in an unusable way, unless your mouse pointer doesn't move. I think things are overlapping (z-index) and causes the flicker, but I don't know what exactly.

            Maybe you'd be able to see why better than me :)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              arminunruh
              Global Moderator
              wrote on Jun 14, 2023, 10:48 AM last edited by
              #6

              well, i should probably just add a feature for this one day

              maybe sth in your code is wrong and thats why it doesn't work. do u have a link

              always post a link to where the problem is

              V 1 Reply Last reply Jul 20, 2023, 6:13 PM
              0
              • A arminunruh
                Jun 14, 2023, 10:48 AM

                well, i should probably just add a feature for this one day

                maybe sth in your code is wrong and thats why it doesn't work. do u have a link

                always post a link to where the problem is

                V Offline
                V Offline
                vthevoz
                wrote on Jul 20, 2023, 6:13 PM last edited by
                #7

                @arminunruh just a quick update to announce I've finally been able to de-activate pointer events while keeping the hover image feature.

                Basically, there was an obvious conflict (the glitch part) between:

                .projectindex-project-slug-example a:active {
                cursor: default;
                }

                and

                .projectindex-project-slug-example a:hover {
                cursor: default;
                pointer-events:none;
                }

                So I just moved the pointer-events:none; to the active state of the project slug link class while keeping the default uploaded cursor design. And now it works!

                www.virgilethevoz.com

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  arminunruh
                  Global Moderator
                  wrote on Jul 26, 2023, 7:09 PM last edited by
                  #8

                  ok nice!!

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  I also code custom websites or custom Lay features.
                  💿 Email me here: 💿
                  info@laytheme.com

                  Before you post:
                  1. When using a WordPress Cache plugin, disable it or clear your cache.
                  2. Update Lay Theme and all Lay Theme Addons
                  3. Disable all Plugins
                  4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                  This often solves issues you might run into

                  When you post:
                  1. Post a link to where the problem is
                  2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                  3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                  Online Users
                  M
                  MWPA
                  21 minutes ago
                  Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                  laytheme.com
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Search