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. Change colour of sitetitle on black row — Not working after update

Change colour of sitetitle on black row — Not working after update

Scheduled Pinned Locked Moved General Discussion
8 Posts 4 Posters 817 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.
  • A
    A
    acmarion
    wrote on last edited by
    #1

    Hi!

    I used the code I found in 2 older threads to make my navigation (site title + menu) change from black to white when it's over a black background (class id: blackrow), it was working for a while then I came back in the admin and updated and now it's not working.

    Here is the code I am using:

    Custom CSS:

    /* Nav color change */
    .blackrow {
        background: #0e0e0e;
    }
    
    .white {
        color: #f2f2f2;
    }
    

    Custom HTML at bottom:

    <!--Nav color change-->
    <script>
        var offset = 50;
        var $blackRows;
        var $nav;
        
        Frontend.GlobalEvents.on("newpageshown", function(layoutObj, type, obj){
            $blackRows = jQuery(".blackrow");
            $practice = jQuery(".info-centre-top");
            $mobiletitle = jQuery(".mobile-title span");
            $information = jQuery(".laynav span");
            $nav = jQuery(".navbar");
            $nav.removeClass("white");
            $sitetitle = jQuery(".sitetitle span");
        });
        
        jQuery(document).on("scroll", function(){
    
            $blackRows.each(function(){
                var rect = this.getBoundingClientRect();
                if(rect.top - offset < 0 && rect.bottom - offset > 0){
                    $sitetitle.addClass("white");
                    $mobiletitle.addClass("white");
                    $practice.addClass("white");
                    $information.addClass("white");
                    return false;
                }else{
                    $sitetitle.removeClass("white");
                    $mobiletitle.removeClass("white");
                    $practice.removeClass("white");
                    $information.removeClass("white");
                }
            });
        });
    </script>
    

    Does anyone know why it's not working anymore?

    Thanks!

    1 Reply Last reply
    0
    • RichardR
      RichardR
      Richard
      Global Moderator
      wrote on last edited by
      #2

      Dear @acmarion

      Apologies for the late reply over the weekend,
      It makes me curious that possibly since the last update one of the Classes is now called something slightly different and this has caused a problem

      However
      I will forward this To Armin for a deeper look!

      Thank you for your patience and for using Lay Theme

      Best wishes
      Sincerely
      Richard

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

        please always post your website address.

        can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?

        A 1 Reply Last reply
        0
        • arminunruhA arminunruh

          please always post your website address.

          can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?

          A
          A
          acmarion
          wrote on last edited by acmarion
          #4

          @arminunruh I just sent you an email with the info you requested.

          Also my website (work in progress) is dev.alexiscoutumarion.com

          Thanks!

          1 Reply Last reply
          0
          • RichardR Richard

            Dear @acmarion

            Apologies for the late reply over the weekend,
            It makes me curious that possibly since the last update one of the Classes is now called something slightly different and this has caused a problem

            However
            I will forward this To Armin for a deeper look!

            Thank you for your patience and for using Lay Theme

            Best wishes
            Sincerely
            Richard

            A
            A
            acmarion
            wrote on last edited by
            #5

            @Richard-Keith Thanks for you reply. I also think that some Classes names used in the code have changed during the update.

            1 Reply Last reply
            0
            • E
              E
              emidio
              wrote on last edited by
              #6

              I am having the same problem. how did you solved it?

              A 1 Reply Last reply
              0
              • E emidio

                I am having the same problem. how did you solved it?

                A
                A
                acmarion
                wrote on last edited by
                #7

                @emidio Armin helped me by looking at the code, here was his answer:

                you need to use window.laytheme.on

                instead of

                Frontend.Globalevents.on

                as written in the doc:
                http://laytheme.com/documentation.html#custom-javascript

                Sorry for the late reply, I didn't log in for a while.

                1 Reply Last reply
                0
                • RichardR
                  RichardR
                  Richard
                  Global Moderator
                  wrote on last edited by
                  #8

                  Dear @acmarion

                  Thanks for posting!

                  Best
                  Richard

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