Change colour of sitetitle on black row / backgrounds
-
Dear @mariusjopen
Thank you for the tip – much appreciated!
I’ve got to it work as intended – I changed the class to body, as you noted, then added the following to CSS…
.white .sitetitle span { color: white; } .white nav.primary a { color: white; }
One minor thing, the white sitetitle and white menu only appear when you start scrolling down, is there a way to make them appear when the page is loaded, before scrolling? Any tips? The reason I ask is because some pages will have blackrows with a 100% vh as the first image – see this page as an example – https://deslloydbehari.co.uk/portfolio/logos
Thanks again, and best,
Des
-
Dear @Des
you could do that with CUSTOM CSS to have it visible on specific pages.Or you run a Javascript event to make the site title visible on only those pages which you want.
http://laytheme.com/documentation.html#custom-css-styling
http://laytheme.com/documentation.html#custom-javascriptGlad you figured it out!
Best!
Marius
-
Thanks @mariusjopen
I know I can't use the
jQuery(document).ready(function(){
for Lay Theme. But would I need to amend the scroll function –jQuery(document).on("scroll", function(){
to something else, in order for the white sitetitle text / white menu text to load before scrolling?I'm not sure if CSS would be applicable, as I only need to target certain rows, not the whole page?!
Thanks again and best,
Des
-
Hi again @mariusjopen
Just following up the above post – additionally I’ve noticed this jQuery code does not work when the scroll bar option is deactivated, when using Lay’s Fullscreen Slider plugin.
As noted above, would I need to change the function?
jQuery(document).on("scroll", function(){
I had to deactivate the scroll bar option in the Fullscreen Slider, as it flickers when using Chrome – looks fine in Safari and Firefox, but for some reason it flickers when testing in Chrome. The auto-scrolling speed is 1000 milliseconds.
Any thoughts?
Thanks and best,
Des
-
Dear @Des
can you show us a link where it is flickering?What exactly do you try to achieve?
Best!
Marius
-
Hi @mariusjopen
Here is a link: https://deslloydbehari.co.uk/portfolio/logos
When using Chrome (macOS) the Fullscreen Slider seems to flicker with the scroll bar displayed, and doesn’t feel as smooth compared to Safari and Firefox. However, when the scroll bar is disabled the slider navigation is much smoother on Chrome. I've also tested on another Mac, with and without the scroll bar, same result.
Subsequently, when the scroll bar is disabled the JS code I've been using, which makes the sitetitle and menu items text white on dark/black rows no longer works as a result, which I think is due to the scroll bar not being displayed?
For reference, here is the JS code, I’m using:
<script> var offset = 50; var $darkBackgrounds; var $nav; Frontend.GlobalEvents.on("newpageshown", function(layoutObj, type, obj){ $darkBackgrounds = jQuery(".darkbackground"); $nav = jQuery("html, body"); $nav.removeClass("white"); $sitetitle = jQuery(".sitetitle span"); }); jQuery(document).on("scroll", function(){ $darkBackgrounds.each(function(){ var rect = this.getBoundingClientRect(); if(rect.top - offset < 0 && rect.bottom - offset > 0){ $nav.addClass("white"); $sitetitle.text("Des Lloyd Behari"); console.log("white"); return false; }else{ $nav.removeClass("white"); $sitetitle.text("Des Lloyd Behari"); console.log("dark"); } }); }); </script>
I've re-enabled the scroll bar on the above website link, so you can see for yourself.
To summarise, ideally I would like to use the Fullscreen Slider, but with the scroll bar visible, but am willing to compromise and not have it visible, to ensure the scrolling on Chrome is smooth. But this now means the above JS no longer works!
If you need any further details, please let me know.
Many thanks,
Des
-
Dear @Des
maybe you can call the JS whenever the fullscreen slider gets called.But the flickering when the scrollbar is displayed is weird. That looks like a bug.
We will check this.
Best!
Marius
-
Thanks @mariusjopen
I thought it might be a bug with Fullscreen Slider – please do let me know when it’s been checked. Ideally, I would prefer the slider with a scroll bar.
For the JS code, I've added a "mousemove" call, that seems to work, when the scroll bar is deactivated on the Fullscreen Slider.
Thanks again for your help.
Best,
Des
-
Hey!
Hey please update the fullscreen slider addon and the stuttering should be fixed.
For the fullscreen slider you could also use the events:
<script> jQuery(window).on('fpOnLeave', function(obj){ console.log('fp on leave'); console.log(obj.index); console.log(obj.nextIndex); console.log(obj.direction); }); // and jQuery(window).on('fpAfterLoad', function(obj){ console.log('after load'); console.log(obj.index); console.log(obj.anchorLink); }); </script>
-
Hey @arminunruh
Thanks very much, I’ve updated the slider – works perfectly with the scroll bar in Chrome!
Thanks also, for the events code for the slider – much appreciated! Could I use this to make the white sitetitle and white menu appear on any of the first slides that have a black background before scrolling / moving the mouse?
Best,
Des
-
Dear @Des
yes. This should work.Best!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- 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:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it