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. Addons
  3. magnetic slide addon- can I have a different background for each slide on the page?

magnetic slide addon- can I have a different background for each slide on the page?

Scheduled Pinned Locked Moved Addons
cssmagnetic slidecustom csschange backgrou
5 Posts 3 Posters 2.4k Views 2 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.
  • Y
    Y
    ymaung
    wrote on last edited by
    #1

    Hi, I have the magnetic slide add-on. I want to have a different background for each slide on the page, how can I change the css for this?
    Thanks,
    Yin

    arminunruhA 1 Reply Last reply
    0
    • arminunruhA
      arminunruhA
      arminunruh
      Global Moderator
      wrote on last edited by arminunruh
      #2

      Hi Yin!
      First, you need to learn about some CSS selectors to target specific projects, pages and categories. Please take a look at my post here about how to change the background color of a whole page, project or category:
      http://laythemeforum.com/topic/10/different-backgroundcolor-for-single-project/4

      Ok but we just want to change the background colors of the slides. To do that, you use the so called "nth-child" CSS selector: https://developer.mozilla.org/en-US/docs/Web/CSS/%3Anth-child

      We add all the CSS to the field "Custom CSS for Desktop Version" in "Lay Options" -> "Misc Options".

      We need to select .fp-section elements because these are the slides.
      Let's say the second slide's background should be pink. This slide is in a project with the id of "32".

      body[data-id="32"][data-type="project"] .fp-section:nth-child(2){
          background-color: pink;
      }
      

      If you want to make every second slide pink on your whole website you can use this:

      body[data-type="project"] .fp-section:nth-child(2){
          background-color: pink;
      }
      

      The following CSS makes every even slide pink and every odd slide green in the project with the id 32.

      body[data-id="32"][data-type="project"] .fp-section:nth-child(even){
          background-color: pink;
      }
      
      body[data-id="32"][data-type="project"] .fp-section:nth-child(odd){
          background-color: green;
      }
      

      Hope that helps!

      1 Reply Last reply
      0
      • Y ymaung

        Hi, I have the magnetic slide add-on. I want to have a different background for each slide on the page, how can I change the css for this?
        Thanks,
        Yin

        arminunruhA
        arminunruhA
        arminunruh
        Global Moderator
        wrote on last edited by
        #3

        @ymaung
        Now it's easier to set background colors for each row! Update your Lay Theme to version 1.030. Then right click on a row in the gridder. In the context menu you can choose "set background color". Cool huh?

        1 Reply Last reply
        0
        • irvdysI
          irvdysI
          irvdys
          wrote on last edited by irvdys
          #4

          @arminunruh it doesnt work on mobile device and tablet :(

          arminunruhA 1 Reply Last reply
          0
          • irvdysI irvdys

            @arminunruh it doesnt work on mobile device and tablet :(

            arminunruhA
            arminunruhA
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            @irvdys yeah gonna take at that look today :D

            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
            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