[Resolved] Text appear in banner when page is not fully loaded
This thread is resolved. Here is a description of the problem and solution.
Problem:
How to control (show/hide) html elements while page load
Solution:
It is not really possible for Layouts to anticipate everything that any other plugin or theme might do to dictate what loads when.
You could add some custom JS to your which does something like set the opacity on the
to 0 while the page loads and then uses an onload or document ready event to switch the opacity to 1 to reveal the page. (You couldn't set the opacity to 0 via CSS and then use JS to set it to 1 in case JS is disabled or unavailable for some reason.)
So I would suggest you should try to add your code to section.
I have encountered frequent issue whereby my section title text will appear in the banner before the page is fully loaded.
I have attached 2 screenshots.
1.png shows the issue when the page is not fully loaded.
2.png is the correct output when the page is fully loaded.
Please advise how should I go about resolving this issue as this introduce poor user experience.
If you require my site URL for troubleshooting, please assist to set the next reply to private or let me know if I can send you via private message because my website is still not officially live yet.
Hello. Thank you for contacting the Toolset support.
Actually - this issue is related to the order in which page is loaded. I suggest you may use some CSS gray out overlay trick to hide the page or display the div after the page is loaded.
It is not really possible for Layouts to anticipate everything that any other plugin or theme might do to dictate what loads when.
You could add some custom JS to your <HEAD> which does something like set the opacity on the <BODY> to 0 while the page loads and then uses an onload or document ready event to switch the opacity to 1 to reveal the page. (You couldn't set the opacity to 0 via CSS and then use JS to set it to 1 in case JS is disabled or unavailable for some reason.)
So I would suggest you should try to add your code to <HEAD> section.
Can you advise what is the best practice to add the code into <HEAD>?
I went to Appearance > Editor > Toolset Starter theme > Theme Header (header.php) and add the code there but somehow it does not reflected in the frontend.
Therefore, I went to install "Insert Headers and Footers" plugin and insert the code to <head> tag using the plugin.
I tried to enter the code below and it does not have any effect.
I put in some alert for troubleshooting, only alert('1)' is firing.
Back to the initial question, i realized that if i disabled my browser JavaScript, the Section title will stuck in the banner area even when the page is fully loaded.
Please advise how can i troubleshoot further to resolve this issue?
I meant if I disable JavaScript, the problem will exist before and after page load completed.
If I enable JavaScript, the problem will only exist before page load.