Page 1 of 1

***SOLVED***How to toggle an object or layer's visibility?

Posted: Mon Sep 21, 2020 9:51 pm
by Philip Fong
I want to hide a sticky layer when another object is visible and unhide when with another object, such as on "invisible" hide or show, thanks.

Re: How to toggle an object or layer's visibility?

Posted: Mon Sep 21, 2020 11:39 pm
by pajadt
Hi
You want one layer object to be visible and the other not, and when you click on for example shape, the first layer is hidden and the second appears with toggle.

That you can get with options event at shape
- if layer1 and layer 2 same size and position than you can do toggle only at second layer, which must be hidden - and activate him click at shape

- if layer1 and layer 2 not same size or not have same position than must create two shapes where first hide first layer, and activate second / with events
1. toggle layer 2
2. hide layer 1

Ar Second shape do next with events
1. toggle layer 1
2. hide layer 2

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 8:18 am
by Philip Fong
Thanks, but I wanted the "hide" & "unhide" with the "visibility" of the other object like: When object A is visible in the page, Object B is hidden and vise versa, without mouse click.

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 9:03 am
by Pablo
There is no standard solution for this. There is no event in HTML that is triggered when the visibility of an object changes, so this requires a custom script where you keep track of the visibility with a variable.

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 1:37 pm
by Philip Fong
I see, I was hoping web design tool can do that or HTML5 should have feature like Flash animation in the past. Thank anyway. :D

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 3:02 pm
by pajadt
Hi
You didn't explain exactly what exactly you want to achieve with the design, what you use layers, grids, maybe it's possible, or share the project or example where u see that, or contact me via fb. Maybe it can be done

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 3:56 pm
by Philip Fong
Occasionally, I saw some website that has mini menu button that appear when scroll down and disappear when reached the top, I don't see any extension that can do that.

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 3:59 pm
by Pablo
You can use scroll events to implement this.
https://wysiwygwebbuilder.com/bookmark_events.html

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 4:26 pm
by Philip Fong
The bookmark event can only show the hidden object when scroll down but cannot hide it after that when I scroll back to the top, I want the object remain visible no matter how far down but must hide when it reaches back to the top, I tried using another bookmark to hide it but no effect.

I can show & hide it if I use the same bookmark but only a short visible section.

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 5:57 pm
by wwonderfull
Without seeing your project on what you are up to, or visualizing what you really want, it is very difficult to perceive what would be your satisfying result. The viewport transition may take custom script may look great or may look non responsive in mobile devices as layers are not responsive. If you want you can illustrate what you want (Draw and give us a screen shot) and if there is an alternative way of showing what you want to view then may be we can aid some support.

Re: How to toggle an object or layer's visibility?

Posted: Tue Sep 22, 2020 6:20 pm
by BaconFries
wwonderfull wrote: Tue Sep 22, 2020 5:57 pm as layers are not responsive.
Where does it say layers are not "Responsive" they can be used but it is probably best to use "Layout Grids" or "Flex Grid / Box"
Create a responsive website with anchored layers
https://www.wysiwygwebbuilder.com/anchored_layers.html
Create a responsive website with floating layers
https://www.wysiwygwebbuilder.com/floating_layers.html
Which layout mode should I choose?
Layers
https://www.wysiwygwebbuilder.com/forum ... 10&t=76722

Re: How to toggle an object or layer's visibility?

Posted: Wed Sep 23, 2020 8:40 am
by Philip Fong
Ok, I found a way using animate javascript instead. the file is here, thank you very much for the help.
https://drive.google.com/file/d/1ffw-ur ... sp=sharing