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. 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 268 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.
  • A Offline
    A Offline
    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 Offline
      RichardR Offline
      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 Offline
        arminunruhA Offline
        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 Offline
          A Offline
          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 Offline
            A Offline
            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 Offline
              E Offline
              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 Offline
                A Offline
                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 Offline
                  RichardR Offline
                  Richard
                  Global Moderator
                  wrote on last edited by
                  #8

                  Dear @acmarion

                  Thanks for posting!

                  Best
                  Richard

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