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. Custom CSS by categories

Custom CSS by categories

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 513 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.
  • S Offline
    S Offline
    sjg123
    wrote on last edited by sjg123
    #1

    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
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      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
      0
      • S Offline
        S Offline
        sjg123
        wrote on last edited by sjg123
        #3

        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
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          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
          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
          arminunruhA
          arminunruh
          F
          francesco
          L
          lurchifon
          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