Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #25285
| Date | 2014-07-10 22:13 +1000 |
|---|---|
| From | Andrew Poulos <ap_prog@hotmail.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Element visible |
| References | (2 earlier) <j9idnT3Ozq34JSHOnZ2dnUVZ_hydnZ2d@westnet.com.au> <13026944.5APpuSVIFp@PointedEars.de> <wNmdnUw9Ar6cRyDOnZ2dnUVZ_sudnZ2d@westnet.com.au> <XnsA3665E3F5E33Feejj99@194.109.133.133> <lplgam$fdo$1@dont-email.me> |
| Message-ID | <xNqdncwLDYSUGSPOnZ2dnUVZ_judnZ2d@westnet.com.au> (permalink) |
On 10/07/2014 5:45 PM, Jukka K. Korpela wrote: > 2014-07-10 10:15, Evertjan. wrote: > >> Do you have a javascript related Q? > > I have not had difficulties with understanding the question or with > seeing it as being on-topic. The question was about ways to know if an > element could be visible, and it seems obvious, in the context of this > group, that it meant to ask how to test such a thing in JavaScript. > Basically, how could you write a JavaScript function that takes an > element node as argument and returns true or false depending on whether > the element is visible or not. > > The main problem with the question is that it is too vague. What is > “visible” in this context. You already made some good points about this. > Apparently some of the conditions for being visible, in some sense, are > things you cannot test in JavaScript, like the user being blind. But > many things, like the position of the element, its dimensions, and CSS > styles and HTML attributes that apply to it, can be tested, to some > extent at least. > > Instead of theoretical discussions about such aspects and detailed > treatment of how some specific things affecting visibility might be > tested, maybe the OP should clarify what he is trying to accomplish. > Some sample code, preferably with a link to an online demo, would > greatly help in understanding what the practical problem is. I've found window.matchMedia and together with addListener (given I'll need to work around the lack of support for it in IE 9) I should be able to track the "visibility" of the things that need tracking. Andrew Poulos
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Element visible Andrew Poulos <ap_prog@hotmail.com> - 2014-07-09 10:09 +1000
Re: Element visible Andrew Poulos <ap_prog@hotmail.com> - 2014-07-09 13:32 +1000
Re: Element visible "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-09 09:54 +0200
Re: Element visible Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-09 11:18 +0200
Re: Element visible Andrew Poulos <ap_prog@hotmail.com> - 2014-07-09 23:17 +1000
Re: Element visible John Harris <niam@jghnorth.org.uk.invalid> - 2014-07-09 16:08 +0100
Re: Element visible Andrew Poulos <ap_prog@hotmail.com> - 2014-07-10 10:07 +1000
Re: Element visible "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-10 09:15 +0200
Re: Element visible "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-07-10 10:45 +0300
Re: Element visible Andrew Poulos <ap_prog@hotmail.com> - 2014-07-10 22:13 +1000
Re: Element visible "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-10 14:31 +0200
Re: Element visible Scott Sauyet <scott.sauyet@gmail.com> - 2014-07-10 13:35 -0700
Re: Element visible "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-11 00:23 +0200
Re: Element visible Scott Sauyet <scott.sauyet@gmail.com> - 2014-07-12 20:09 -0700
Re: Element visible "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-13 09:07 +0200
Re: Element visible John Harris <niam@jghnorth.org.uk.invalid> - 2014-07-10 10:46 +0100
Re: Element visible Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-10 12:10 +0200
Re: Element visible Andrew Poulos <ap_prog@hotmail.com> - 2014-07-14 13:00 +1000
Re: Element visible Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-07-15 15:08 +0200
csiph-web