Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
aab7d18d
...
aab7d18de1fda93e0ca1d7e0a96872e173990e69
authored
2012-05-25 18:04:14 -0700
by
Marcel Duran
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
checking element visibility through computed styles
1 parent
f8d75e2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
modules/clientutils.js
modules/clientutils.js
View file @
aab7d18
...
...
@@ -546,8 +546,14 @@
*/
this
.
visible
=
function
visible
(
selector
)
{
try
{
var
el
=
this
.
findOne
(
selector
);
return
el
&&
el
.
style
.
visibility
!==
'hidden'
&&
el
.
offsetHeight
>
0
&&
el
.
offsetWidth
>
0
;
var
comp
,
el
=
this
.
findOne
(
selector
);
if
(
el
)
{
comp
=
window
.
getComputedStyle
(
el
,
null
);
return
comp
.
visibility
!==
'hidden'
&&
comp
.
display
!==
'none'
&&
el
.
offsetHeight
>
0
&&
el
.
offsetWidth
>
0
;
}
return
false
;
}
catch
(
e
)
{
return
false
;
}
...
...
Please
register
or
sign in
to post a comment