Skip to main content

Questions tagged [visibility]

Visibility is an attribute of an object. It may refer to the concept of having something visible (or not) on the graphical interface, or a symbol visibility in linkage. This tag should not be used in place of the more specific tags [memory-visibility] or [class-visibility].

8698 votes
67 answers
3.2m views

How do I check if an element is hidden in jQuery?

How do I toggle the visibility of an element using .hide(), .show(), or .toggle()? How do I test if an element is visible or hidden?
Philip Morton's user avatar
1394 votes
21 answers
759k views

What is the difference between visibility:hidden and display:none?

The CSS rules visibility:hidden and display:none both result in the element not being visible. Are these synonyms?
Chris Noe's user avatar
  • 36.9k
560 votes
45 answers
312k views

How to check visibility of software keyboard in Android?

I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android?
fhucho's user avatar
  • 34.4k
399 votes
6 answers
661k views

Equivalent of jQuery .hide() to set visibility: hidden

In jQuery, there are .hide() and .show() methods which sets the CSS display: none setting. Is there an equivalent function which would set the visibility: hidden setting? I know I can use .css() ...
Tomas's user avatar
  • 58.9k
327 votes
4 answers
164k views

Difference between Visibility.Collapsed and Visibility.Hidden

What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?
Sauron's user avatar
  • 16.8k
192 votes
12 answers
197k views

DataTrigger where value is NOT null?

I know that I can make a setter that checks to see if a value is NULL and do something. Example: <TextBlock> <TextBlock.Style> <Style> <Style.Triggers> <...
Timothy Khouri's user avatar
171 votes
18 answers
125k views

How do I invert BooleanToVisibilityConverter?

I'm using a BooleanToVisibilityConverter in WPF to bind the Visibility property of a control to a Boolean. This works fine, but I'd like one of the controls to hide if the boolean is true, and show if ...
user avatar
162 votes
3 answers
56k views

What is the difference between the hidden attribute (HTML5) and the display:none rule (CSS)?

HTML5 has a new global attribute, hidden, which can be used to hide content. <article hidden> <h2>Article #1</h2> <p>Lorem ipsum ...</p> </article> CSS has ...
james.garriss's user avatar
147 votes
9 answers
619k views

How to make a DIV visible and invisible with JavaScript?

Can you do something like function showDiv() { [DIV].visible = true; //or something }
user avatar
142 votes
4 answers
53k views

Hide/show element with a boolean

I tend to have a lot of these in my code if(shouldElementBeVisible) $element.show() else $element.hide() Is there any more elegant way packaged with javascript, jquery, or underscore? ...
Akhil F's user avatar
  • 7,692
135 votes
6 answers
38k views

Default visibility of class methods in PHP

I looked at the manual, but I can't seem to find the answer. What is the default visibility in PHP for methods without a visibility declaration? Does PHP have a package visibility like in Java? ...
Yada's user avatar
  • 30.9k
132 votes
15 answers
139k views

How do I check if an element is really visible with JavaScript? [duplicate]

In JavaScript, how would you check if an element is actually visible? I don't just mean checking the visibility and display attributes. I mean, checking that the element is not visibility: hidden or ...
Macha's user avatar
  • 14.6k
120 votes
5 answers
40k views

Package protected alternative in Kotlin

In Java, we have the package protected (default) modifier for classes, which allows us to have many classes in a single package but exposes only a few and keeps the logic encapsulated. With Kotlin ...
vach's user avatar
  • 11.1k
119 votes
8 answers
115k views

Animate visibility modes, GONE and VISIBLE

So im trying to animate when i set the visibility of a linearlayout with other widgets, from GONE to VISIBLE and the opposite.Im using togglebuttons to show and hide. Here's an image to show what i ...
Maxrunner's user avatar
  • 1,965
107 votes
4 answers
74k views

Private constructor in Kotlin

In Java it's possible to hide a class' main constructor by making it private and then accessing it via a public static method inside that class: public final class Foo { /* Public static method */...
Marvin's user avatar
  • 1,900
99 votes
4 answers
66k views

Binding Visibility for DataGridColumn in WPF

How can I hide a column in a WPF DataGrid through a Binding? This is what I did: <DataGridTextColumn Header="Column header" Binding="{Binding ColumnValue}" ...
ygoe's user avatar
  • 19.8k
97 votes
13 answers
106k views

Determine whether UIView is visible to the user?

Is it possible to determine whether my UIView is visible to the user or not? My View is added as a subview several times into a UITabBarController. Each instance of this view has an NSTimer that ...
jantimon's user avatar
  • 37.7k
97 votes
3 answers
55k views

What is DOM reflow?

I was reading about the difference between two CSS properties display:none and visibility:hidden and encountered the DOM reflow term. The statement was display: none causes a DOM reflow whereas ...
Suresh Karia's user avatar
84 votes
9 answers
26k views

android View with View.GONE still receives onTouch and onClick

This is confusing me: As far as I have read, a view with setVisibility(View.GONE); should not receive any more touch- or click events. My layout has two parts, which will be visible or gone so that ...
ShadowMare's user avatar
  • 2,097
84 votes
5 answers
96k views

Protected and private methods in Rails

Method visibility in Ruby (public, protected, and private methods) has been well explained in places like this blog post. But in Ruby on Rails it seems slightly different than it would be in a regular ...
jrdioko's user avatar
  • 33k
82 votes
4 answers
62k views

CSS: Is a hidden object clickable?

If the visibility property of the style of an HTML element is set to hidden, is it still clickable? When the display property is set to none, the element is not even part of the DOM tree, so that is ...
euphoria83's user avatar
82 votes
3 answers
11k views

Why is there no sub-class visibility modifier in Java?

On more than one occasion I have found myself desiring a variable visibility that is not possible in Java. I wanted certain members to be visible within their own class and within any sub-classes, ...
Michael McGowan's user avatar
80 votes
13 answers
34k views

iOS equivalent for Android View.GONE visibility mode

I'm developing an app for iOS and I'm using the Storyboard with AutoLayout ON. One of my view controllers has a set of 4 buttons, and in certain circumstances i would like to make the first one ...
elbuild's user avatar
  • 4,889
76 votes
5 answers
46k views

jquery fade element does not show elements styled 'visibility: hidden'

I have a bunch of thumbnails which I am loading with a style of visibility: hidden; so that they all maintain their correct layouts. Once the page is fully loaded I have a jquery function that fades ...
kalpaitch's user avatar
  • 5,241
72 votes
4 answers
60k views

In WPF, how can I determine whether a control is visible to the user?

I'm displaying a very big tree with a lot of items in it. Each of these items shows information to the user through its associated UserControl control, and this information has to be updated every 250 ...
Trap's user avatar
  • 12.3k
71 votes
4 answers
41k views

UIView hide children views when out of bounds

I have a view, lets say 100x100. And it has set of uiviews as subviews: let say 30x30 If a subview has top-left coordinate: (90,90) - I expect to see only part of this subview. But I still see entire ...
user349302's user avatar
  • 3,691
71 votes
3 answers
38k views

Is there any way to set a private/protected static property using reflection classes?

I am trying to perform a backup/restore function for static properties of classes. I can get a list of all of the static properties and their values using the reflection objects getStaticProperties() ...
dqhendricks's user avatar
  • 19.2k
71 votes
2 answers
37k views

What is the CMake equivalent to "gcc -fvisibility=hidden" when controlling the exported symbol of a shared library?

I developed cross platform software in c++. As I know, Linux .so exported all the symbols by default, well through "gcc -fvisibility=hidden" I can set all the exported symbols as hidden, then set ...
sailing's user avatar
  • 710
71 votes
5 answers
28k views

Why does jQuery show/hide use display:none instead of visibility:hidden?

display:none means that the element isn't rendered as part of the DOM, so it's not loaded until the display property changes to something else. visibility:hidden loads the element, but does not show ...
isayno's user avatar
  • 755
68 votes
6 answers
29k views

Why doesn't setVisibility work after a view is animated?

Why doesn't the textView become invisible? Here is my layout xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:...
ZippyFerguson's user avatar

15 30 50 per page
1
2 3 4 5
107