0

I am trying to detect not only the width of the window/screen but the height as well. I am using the below jquery to get the width but would like it to factor in the height as well before proceeding with the redirect.

I have a fullscreen image (standard 16:9) that scales proportionally unless the users height is larger then the width. Which is why I would like to detect both the height and width

<script>  
if($(window).width() < 800){

window.location = "http://www.examplesite.com/something"

}
</script>
JohnW7989
  • 55
  • 1
  • 6
  • don't get it, just use `$(element).height()`...? – benomatis Oct 15 '14 at 04:51
  • @webeno Where would I add $(element).height() to the code. I am not very familiar with jquery so i was having a hard time getting it to work with both a height and width attribute. – JohnW7989 Oct 15 '14 at 04:55
  • possible duplicate of [What is the best way to detect a handheld device in jQuery?](http://stackoverflow.com/questions/3514784/what-is-the-best-way-to-detect-a-handheld-device-in-jquery) – benomatis Oct 15 '14 at 04:59
  • @webeno I am trying to do something a bit different. I have a fullscreen image that scales proportionally unless the users height is larger then the width. Which is why I would like to detect both the height and width. – JohnW7989 Oct 15 '14 at 05:05
  • edit your original question and provide this info, some more code would also be welcome – benomatis Oct 15 '14 at 05:17

0 Answers0