Page 1 of 1
Reload and hide
Posted: Wed Dec 28, 2022 9:00 am
by SergeFog
Is it possible by an "events" to reload a page and then hide a text?
Re: Reload and hide
Posted: Wed Dec 28, 2022 9:54 am
by Pablo
You can reload the page with events, but you cannot change the state of an element after the page has been reloaded.
But why do you need to reload the page to hide an element?
Re: Reload and hide
Posted: Wed Dec 28, 2022 11:26 am
by jerryco
Can't you just clone the page and redirect to it with the element out?
Re: Reload and hide
Posted: Wed Dec 28, 2022 4:06 pm
by SergeFog
In the page I have 3 texts of which 2 are hidden.
If I raise the text present on the page upwards, and hide the text so that I can see another text, this text is also upwards and not at its beginning.
I tried reloading the page and then changing the text to "hide" and "show", but it didn't work.
In my site there are hundreds of pages thus constructed (3 texts or more).
Re: Reload and hide
Posted: Wed Dec 28, 2022 4:42 pm
by Pablo
Sorry, but I still do not understand what you are trying to do.
Why do you need to reload the page?
if you use events to show / hide an element and reload the page, then the browser will not remember the previous state of the element.
Re: Reload and hide
Posted: Wed Dec 28, 2022 4:43 pm
by crispy68
Are the text objects layered (or on top) of each other? Can you explain more of the set up and what you are wanting to happen from a user end?
Re: Reload and hide
Posted: Wed Dec 28, 2022 7:31 pm
by SergeFog
There is a "layer" at the top of the page with a "CSS Menu".
Below the layer there are three texts.
In the menu, there are "Events" which hide two texts and make the third text appear.
The texts have between three lines and several dozen lines.
If the visible text is scrolled, the hidden texts also go up. And when changing text the new text is not on its first line.
Re: Reload and hide
Posted: Wed Dec 28, 2022 7:47 pm
by crispy68
Can you upload a demo so we can see what is doing?
So the text is not in any container? Are they on top of each other? next to each other? stacked? So what is supposed to happen? Are there 3 different menu buttons where each button shows a text block and the other 2 are hidden? Still not clear on what you are trying to do.
Re: Reload and hide
Posted: Wed Dec 28, 2022 8:15 pm
by SergeFog
https://www.dropbox.com/s/to1d8xsipvr0bmp/TEST.wbs?dl=0
Scroll up the text, and then change the text.
The new text is not on the first line.
Re: Reload and hide
Posted: Wed Dec 28, 2022 11:35 pm
by crispy68
Your layout works as intended and is correct.
The text blocks are using absolute positioning and are outside of the layer which is using fixed positioning to the top. The only way to make the text appear below your menu is the text also needs to use fixed positioning or they need to be inside the same layer(container) as the menu. The way you have it set up it won't work.
For example, if you want the text blocks to stay fixed to the top below the menu, you would need to add some CSS:
Code: Select all
<style>
#wb_Text1,#wb_Text2,#wb_Text3{position:fixed !important;top:30px !important;left:50% !important;transform:translateX(-50%);}
</style>
Note: You can remove the "!important" from the code above you if go to Tools --> Options --> HTML --> and check Optimize inline styles
However, the problem you may have is that your longer text is going to overlap content below when it is shown. Are you expecting the content below to move up and down to give space for your text blocks? If so, then you will need to look at a floating layout instead using grids.
Re: Reload and hide
Posted: Thu Dec 29, 2022 7:40 am
by SergeFog
I have never used a code.
How do I proceed
Re: Reload and hide
Posted: Thu Dec 29, 2022 1:06 pm
by crispy68
You can either use a html object or add it to the page html under page properties and place between the <head> tags.