Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Resize</title>
- <script type="text/javascript">
- var viewportwidth;
- var viewportheight;
- function resize() {
- // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
- if (typeof window.innerWidth != 'undefined') {
- viewportwidth = window.innerWidth,
- viewportheight = window.innerHeight
- }
- // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
- else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
- viewportwidth = document.documentElement.clientWidth,
- viewportheight = document.documentElement.clientHeight
- }
- // older versions of IE
- else {
- viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
- viewportheight = document.getElementsByTagName('body')[0].clientHeight
- }
- if(viewportwidth >= 700) {
- //window.reload();
- alert("reload");
- }
- }
- </script>
- </head>
- <body onload="resize()" onresize="resize()">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement