How to check if the element is visible using Dojo 1.9?

I use the following code to hide or show fields:

Show elements:

style.set (dojo.byId('fTypeId'),'display','block');

Hidden elements:

style.set(dojo.byId ('fTypeId'),'display','none');

How to test whether this element is displayed?

try:

 require(["dojo/dom-style"], function(domStyle){
var isVisible = (domStyle.get("yourNodeId", "display") !== "none");
} );

I use the following code to hide or show fields:

Show elements:

style.set(dojo.byId('fTypeId'),'display','block');

Hidden elements:

style .set(dojo.byId('fTypeId'),'display','none');

How to test whether this element is displayed?

Try:

require(["dojo/dom-style"], function(domStyle){
var isVisible = (domStyle.get("yourNodeId", "display") !== "none");
});

Leave a Comment

Your email address will not be published.