Ask a Question

Parallax image

ḥari
Frequent Contributor

Parallax image

Hello team
I have parallax image in a web page while i am scrolling the page till some point that image will be scrolling in the background of that page. Is it possible to verify that image is visible on screen while am scrolling the page??
12 REPLIES 12
rraghvani
Champion Level 2

I understand that. 

 

But you have to understand how your page is built, as not all CSS pages will have that property value set. In this example the visibility value changes depending on how much is scrolled,

rraghvani_3-1685007429812.png

rraghvani_2-1685007374189.png

It can be seen clearly while using DevTools. 

 

You might have different element, property, attribute value that's changing which might not be shown in TC. 

ḥari
Frequent Contributor

In devtool i didn't see any visibility property over there.
Can i use like this
Var img=page.findelement("xpath"). getBoundingClientRect(). top;
If(img>0)
Log. Message ("visible")
Else
Log. Message ("not visible")

After scroll to some point
If(img<0)
Log. Message ()
Else
Log. Message ()

Here img value before scrolling greater than 0 value after scrolling less than 0
If I am wrong correct me
eykxas
Frequent Contributor

I can't tell you which value is appropriate for your case. In my test, the image is not visible at -300. But it depends on how various elements of your webpage are organized.

cancel
Showing results for 
Search instead for 
Did you mean: