JQuery function returns incorrect amount of pixels

DennisVA

I have a webview that contains some js and jquery

var viewport_top = $window.scrollTop() is called within a function,

the problem is that this function returns an incorrect amount of pixels, i can see that from displaying an alert

My webview height is around 1600 pixels, when i scroll the height of my screen and call that function, it returns something around 500, which is like +- 1/3rd if what is should be

Why is this happening?

DennisVA

Nevermind, i found the answer.

Appearantly pixels can have different sizes, i found out by calling window.devicePixelRatio

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

jQuery fire a function after set amount of pixels is scrolled

Android DisplayMetrics returns incorrect screen size in pixels

Applying custom function to data.table by row returns incorrect amount of values

Python: Function is looping the amount of times there is incorrect input

Len function returns incorrect results

Python function returns incorrect value

checkPrime function returns incorrect values

jQuery Index returns incorrect results

jQuery scroll event: how to determine amount scrolled (scroll delta) in pixels?

"introspect" expected amount of returns within function

Incorrect work of jQuery function .text()

Trying to set ProcessStrictHandleCheckPolicy returns 87 - Incorrect Function

PL/pgSQL function returns incorrect bitwise result

function replace substring returns incorrect answer

PHP rsort function returns incorrect ordering

Function returns incorrect False (only at higher values)

Array formula with SUM Function returns incorrect result

Why does this query function returns incorrect results?

C returns incorrect float value after function returns

Running a function a set amount of times in Jquery

jquery val returns jquery function

How to trigger event after i scroll a page certain amount in pixels from the top? Javascript or Jquery

jQuery: Incorrect use of variables on video function

Remove incorrect pixels from polygons

isoformat function of datetime module in python returns incorrect offset

"Incorrect syntax near 'RETURNS'. Expecting AS, FOR, or WITH." (SQL User Defined Function)

pyspark date_format function returns incorrect year

C function called from Python via ctypes returns incorrect value

getTitle() function returns incorrect result in Selenium web driver