***SOLVED***How to toggle an object or layer's visibility?
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
-
-
- Posts: 22
- Joined: Thu Jul 31, 2014 2:16 pm
***SOLVED***How to toggle an object or layer's visibility?
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?
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
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
-
-
- Posts: 22
- Joined: Thu Jul 31, 2014 2:16 pm
Re: How to toggle an object or layer's visibility?
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?
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.
-
-
- Posts: 22
- Joined: Thu Jul 31, 2014 2:16 pm
Re: How to toggle an object or layer's visibility?
I see, I was hoping web design tool can do that or HTML5 should have feature like Flash animation in the past. Thank anyway. 

Re: How to toggle an object or layer's visibility?
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
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
-
-
- Posts: 22
- Joined: Thu Jul 31, 2014 2:16 pm
Re: How to toggle an object or layer's visibility?
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?
You can use scroll events to implement this.
https://wysiwygwebbuilder.com/bookmark_events.html
https://wysiwygwebbuilder.com/bookmark_events.html
-
-
- Posts: 22
- Joined: Thu Jul 31, 2014 2:16 pm
Re: How to toggle an object or layer's visibility?
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.
I can show & hide it if I use the same bookmark but only a short visible section.
- wwonderfull
-
- Posts: 1582
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: How to toggle an object or layer's visibility?
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.
- BaconFries
-
- Posts: 5923
- Joined: Thu Aug 16, 2007 7:32 pm
Re: How to toggle an object or layer's visibility?
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
-
-
- Posts: 22
- Joined: Thu Jul 31, 2014 2:16 pm
Re: How to toggle an object or layer's visibility?
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
https://drive.google.com/file/d/1ffw-ur ... sp=sharing