Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • 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 1.0k Views 1 Watching
  • 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
    V
    vthevoz
    wrote on 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
    • arminunruhA
      arminunruhA
      arminunruh
      Global Moderator
      wrote on last edited by arminunruh
      #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

      jenswindolfJ 1 Reply Last reply
      0
      • arminunruhA arminunruh

        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

        jenswindolfJ
        jenswindolfJ
        jenswindolf
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • arminunruhA arminunruh referenced this topic on
        • V
          V
          vthevoz
          wrote on 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
          0
          • V vthevoz

            @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
            V
            vthevoz
            wrote on 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
            • arminunruhA
              arminunruhA
              arminunruh
              Global Moderator
              wrote on 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
              0
              • arminunruhA arminunruh

                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
                V
                vthevoz
                wrote on 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
                • arminunruhA
                  arminunruhA
                  arminunruh
                  Global Moderator
                  wrote on last edited by
                  #8

                  ok nice!!

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  Online Users
                  D
                  Dawid
                  L
                  lstark
                  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