Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Custom CSS by categories

    General Discussion
    2
    4
    427
    Loading More Posts
    • 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.
    • S
      sjg123 last edited by sjg123

      Hello,

      I am trying to create a filter effect on a thumbnail grid.

      I have 3 categories on my menu, let's say A, B and C. Each page is a thumbnail grid showing every project thumbnails. But I want that when I click on A, projects thumbnails from categories B and C change opacity.

      I managed to target the page already with:

      .slug-A .thumb {opacity: 0.5;}
      

      Now, every thumbnail changed. But when I target the category:

      .slug-A [data-id=“4”][data-type="category"] .thumb {opacity: 0.5;}
      

      It doesn't work anymore.

      I hope I am clear enough. Does anyone know what I am doing wrong? Thanks!

      1 Reply Last reply Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        Hi sjg123,

        without seeing the actual site it is a bit difficult to imagine.

        For me this sounds more like you need a bit of jQuery to solve this problem. I am not sure if you can do this with pure CSS.

        Let me know how things are going!

        All the best!

        Marius

        www.mariusjopen.world

        1 Reply Last reply Reply Quote 0
        • S
          sjg123 last edited by sjg123

          Hello @mariusjopen ,

          Thanks a lot for your reply. Unfortunately I am working offline for now, so it is not possible to show you the website. But you can see an exemple of what I am trying to achieve here.

          I made a thumbnail grid with all my categories and I am tryting to target the different categories separately, in order to change their opacity.

          I don't know much about jQuery yet, so I will have to look more into it then...

          Thanks!

          1 Reply Last reply Reply Quote 0
          • mariusjopen
            mariusjopen Global Moderator last edited by

            Hi sjg123!

            This looks indeed like you need to use jQuery.

            It will not be that difficult.

            You just need to get the class of the category you click on. And then find all the other elements with the same class and give them a class called active.

            Roughly like that.

            Good luck with this!

            Marius

            www.mariusjopen.world

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            I don't answer or check forum DMs, please just post on the forum.

            Try this to fix issues before you post:

            Use the Search Feature. Maybe there is already a solution to your issue.

            1. Update Lay Theme and all Lay Theme Addons
            2. Disable all Plugins
            3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
            4. Now see if your problem solved itself
            5. Go here, see if your problem is listed here:
            Troubleshooting

            When you post:
            1. Post a link to where the problem is
            2. If the problem is difficult to explain, post screenshots / link to a video to explain it

            Thanks!

            Online Users

            F
            C
            L

            Recent Topics

            • T

              thumbnail grid categories fixed.

            • L

              BLEND MODE ON MOBILE

            • A

              A modal/pop up window displaying extra info

            • Carousel is not showing

            laytheme.com