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. Run script

Run script

Scheduled Pinned Locked Moved General Discussion
5 Posts 2 Posters 1.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.
  • D
    D
    dnlbrv
    wrote on last edited by
    #1

    Hello,
    I need run this script every time you recharge the site. Change the body background-color and background-color in H1

    <script>
    $(document).ready(function(){
    var colors = ['#ff7175','#9fdded', '#ffcccc', '#f9f3a0', '#aeeadd', '#ded3e7', '#e0dcd4'];
    $("body").each(function()
    {
    $(this).css('background-color', colors[Math.floor(Math.random()*colors.length)]);
    $('h1').css('background-color', colors[Math.floor(Math.random()*colors.length)]);
    });
    });
    </script>

    Any idea? when recharge the site the theme put the colors of the preferences.

    Thanxs a lot!

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

      Hey dnlbrv!
      Please take a look at this:
      http://laythemeforum.com/topic/674/random-color-background

      And you need to use "jQuery" instead of "$"

      1 Reply Last reply
      0
      • D
        D
        dnlbrv
        wrote on last edited by
        #3

        Thanks works perfect!

        1 Reply Last reply
        0
        • D
          D
          dnlbrv
          wrote on last edited by
          #4

          Hey, after put the script in to "custom CSS & HTML" the items in "Customize" section disappear. Is its possible?

          Screen Shot 2016-11-07 at 18.39.52.png

          1 Reply Last reply
          0
          • D
            D
            dnlbrv
            wrote on last edited by
            #5

            Sorry, I solved this. No theme bug, the problem was the zomm in the browser.
            Thanks!

            1 Reply Last reply
            1

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