0

I am trying to make a div box move around the page using jquery. I am using the mouseover function with pagex and pagey and then I am using the animate function to change the top and left property based on pagex and y. I want to know if there is a way to check the size of the browser window and if the box is outside those constraints animate it another way because right now my div is making the browser window scroll.

Gregwest85
  • 291
  • 2
  • 4
  • 8
  • This question should help: http://stackoverflow.com/questions/3437786/how-to-get-web-page-size-browser-window-size-screen-size-in-a-cross-browser-wa – Zach Lysobey Apr 04 '13 at 21:17

1 Answers1

0

you can use

 $(window).height()
  $(window).width()

EDIT:

by the way you may need to check $('body').scrollTop and $('body').scrollLeft properties

Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171
  • I tried the ($window).height and width and I notice it changes when the box scrolls. Is there a way to lock the scrolling? – Gregwest85 Apr 04 '13 at 21:42