开发者

ExtJS check if element is visible

开发者 https://www.devze.com 2023-02-01 03:22 出处:网络
Does ExtJ开发者_如何学PythonS provide some quick way to check whether a given component is currently visible? I would normally check css properties like display and visible but what when one of parent

Does ExtJ开发者_如何学PythonS provide some quick way to check whether a given component is currently visible? I would normally check css properties like display and visible but what when one of parent elements is hidden?


Try Ext.Component.isVisible()


Ext.Component.isVisible()

Will work if element was hidden by ExtJs functionality.

If parent component will be hidden (e.g. by using jquery's toggle method calling) - this will not work. So in this case I have used such check:

var el = $('#real_id'); // Id of the inner element 
if($(el).is (':visible') && $(el).parents (':hidden').length === 0) {
   // The element is 100% visible
}

You'll ask why do I need jQuery - the answer is simple: some things can be done more quickly with it... :)

0

精彩评论

暂无评论...
验证码 换一张
取 消