ViewOn Visibility

Is there a way to control the visibility of an object in ViewOn using either Javascripting/JQuery or Basic scripting? I would prefer to do the visibility of a group, but if I need to do individual objects (texts and rectangles) that is fine also.

My current attempts using BASIC scripting inside of ViewOn have been unsuccessful. I’ve tried going to Animations->Visibility on state, using script instead of a tag. What I’m doing is a bit more complicated than examining just one tag, hence the reason why I cannot just reference a standard tag.

Thank you in advance!

@nickTriPhase1

Yes, this is possible and just requires normal JQuery/Javascript functionality. Below are a few different ways you can do this.

//JQuery
$('#YourGroupId').hide(); //hides the element (technically sets css display none)
$('#YourGroupId').css('visibility', "hidden"); //hides the element
$('#YourGroupId').css('display', 'none'); //hides the element
$('#YourGroupId').show(); //shows the element

//Pure Javascript
document.getElementId("YourGroupId").style.display = "none"; // hide element
document.getElementId("YourGroupId").style.visibility = "hidden"; // hide element
document.getElementId("YourGroupId").style.visibility = "initial"; //return to the initial state


All of the above options are completely valid. You can change YourGroupId to be a group or an individual element. Now the only difference with the above solutions is how they actually affect your layout.

Essentially using visibility hidden will hide the element but it will keep the original position and size. So the space on the page remains allocated to the element, if you look at the source code you will see a blank where it used to be. On the opposite end however, with .hide() or display none, they are essentially hidden/removed from the page (you can still bring it back or interact with it though through the DOM) however no space is allocated for it in the page.


Hope this helps!

2 Likes