How to find the center of the browser window using JQuery -


How can I find the coordinates of the browser center using jquery?

Why use jQuery? This can be done with simple plain javascript:

  var horizontalcenter = Math.floor (window.innerWidth / 2); Var vertical senere = mathematics. Floor (window winsight / 2);   

To use these, you may have to add the unit, px to the variable.


Edit to apply an integer value to return coordinates

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -