JQuery for page height and page width, window height, window width

2010-08-18  来源:本站原创  分类:Web  人气:237 

function ___getPageSize() {
                        var xScroll, yScroll;
                        if (window.innerHeight && window.scrollMaxY) {
                                xScroll = window.innerWidth + window.scrollMaxX;
                                yScroll = window.innerHeight + window.scrollMaxY;
                        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                                xScroll = document.body.scrollWidth;
                                yScroll = document.body.scrollHeight;
                        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                                xScroll = document.body.offsetWidth;
                                yScroll = document.body.offsetHeight;
                        }
                        var windowWidth, windowHeight;
                        if (self.innerHeight) { // all except Explorer
                                if(document.documentElement.clientWidth){
                                        windowWidth = document.documentElement.clientWidth;
                                } else {
                                        windowWidth = self.innerWidth;
                                }
                                windowHeight = self.innerHeight;
                        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                                windowWidth = document.documentElement.clientWidth;
                                windowHeight = document.documentElement.clientHeight;
                        } else if (document.body) { // other Explorers
                                windowWidth = document.body.clientWidth;
                                windowHeight = document.body.clientHeight;
                        }
                        // for small pages with total height less then height of the viewport
                        if(yScroll < windowHeight){
                                pageHeight = windowHeight;
                        } else {
                                pageHeight = yScroll;
                        }
                        // for small pages with total width less then width of the viewport
                        if(xScroll < windowWidth){
                                pageWidth = xScroll;
                        } else {
                                pageWidth = windowWidth;
                        }
                        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
                        return arrayPageSize;
                };
相关文章
  • JQuery for page height and page width, window height, window width 2010-08-18

    function ___getPageSize() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document

  • javascript for the page width and height 2010-04-08

    Access to the page with the js code width and height are as follows: 1, IE follows: document.body.scrollWidth; document.body.scrollHeight; 2, Firefox follows: document.documentElement.scrollWidth; document.documentElement.scrollHeight; Obtained, incl

  • Several said the width and height DOM page. From the property 2010-07-31

    <! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN"> <HTML> <HEAD> <TITLE> New Document </ TITLE> <META NAME= "Generator" CONTENT= "EditPlus"> <META NAME= "Autho

  • Min-max settings page width and height (compatible with IE6) 2010-03-30

    /* Minimum width */ .min_width{min-width:300px; /* sets max-width for IE */ _width:expression(document.body.clientWidth < 300 ? "300px" : "auto"); } /* The maximum width */ .max_width{ max-width:600px; /* sets max-width for IE */ _w

  • Access to the page height, window height, the height of the scroll bar parameters getPageSize, getPageScroll 2010-04-22

    function getPageScroll () ( var yScroll; if (self.pageYOffset) ( yScroll = self.pageYOffset; ) Else if (document.documentElement & & document.documentElement.scrollTop) (/ / Explorer 6 Strict yScroll = document.documentElement.scrollTop; ) Else if

  • javaEE using jquery to achieve a single page CURD 2010-07-10

    [Align = center] tools: eclipse 3 Database: mysql 5.0 Write a CURD use jquery plugin jquery-impromptu.2.7.min.js, A page list of additions and deletions to achieve a change investigation, no jumps, access to quickly project structure is as follows: t

  • javascript to get the current window height and width 2009-06-19

    In the javascript to get the current window height and width <body><SCRIPT LANGUAGE="JavaScript"> var s = " Web page visible area width :"+ document.body.clientWidth; s += "\r\n Web page visible area of the high :"

  • JS access to the window width and height 2008-12-10

    DOCTYPE declaration in the absence of circumstances: document.body.clientWidth document.body.clientHeight For the current window width / height; DOCTYPE declaration in the future document.body.clientWidth document.body.clientHeight For the entire pag

  • jquery + ajax no refresh the page GM 2009-11-01

    Custom front page jquery plug-in Universal (1) Framework: Using jquery + ajax + struts1 automatically create rows and columns Persistence layer using a abatis. The database using a MySQL. (B) sqlMap The configuration is as follows shangjia.xml <resul

  • javaScript to obtain the height and width of the window 2010-05-08

    In the javascript get the current window height and width <body> <SCRIPT LANGUAGE="JavaScript"> var s = ""; s + = "\ r \ n page visible area width:" + document.body.clientWidth; s + = "\ r \ n page shows the

  • page inside the iframe call the parent window, so the window function method js 2010-11-18

    page inside the iframe call the parent window, so the window function method to achieve iframe js page directly call within the parent window of the iframe belongs to the custom functions. A window such as there, A There are a IFRAME B, B is C inside

  • JS to get access to the screen size of the browser window, browser, web width height 2010-11-29

    Visible region wide web: document.body.clientWidth Page shows the regional high: document.body.clientHeight Visible region wide web: document.body.offsetWidth (including the edges of the width) Page shows the regional high: document.body.offsetHeight

  • JS to get the page's URL top.location.href and window.location.href 2009-05-11

    JS to get the page URL: (1) The common format is: window.location.href (2), but if you are logged on when the first pop-up a dialog, this dialog box, which is the login page login.jsp, this time in this dialog box if you want to get inside the outerm

  • How to make web page Flash video player in the pop-up window 2010-06-29

    Many browsers have this feature, when you move the mouse to the video on the web page, you can see there is a button appears at the top, pop-up an independent player. When you click the button, the video playback in a new window will pop up, and this

  • Print Page Print Preview Page Setup good Dongdong - WebBrowser. ExecWB complete description of 2008-10-19

    Print Page Print Preview Page Setup good Dongdong - WebBrowser. ExecWB complete description of switched: http://hi.baidu.com/kaisep/blog/item/2bddecde86104b5e95ee3752.html <OBJECT classid = CLSID: 8856F961-340A-11D0-A96B-00C04FD705A2 height = 0 <inp

  • javascript get browser width and height 2010-04-07

    <script language="JavaScript" type="text/JavaScript"> <! - function displayScreenSize () ( var bodyWidth = document.body.clientWidth; / / page width of visible area var bodyHeight = document.body.clientHeight; / / page shows t

  • Jump out in page iframe login page problem 2010-04-14

    ie for the frames ["id"] the other as document.getElementById ("id"). contentWindow contentWindow attribute is specified where the window frame or iframe object In IE, iframe or frame of contentWindow property can be omitted, but in Fi

  • Between the parent page and child page called by JS-value 2010-05-05

    Encountered a problem today, in a page of the JS method call to another page where, after the value of the new page be called back to the question page, use the following methods to achieve the specific realization: Parent page a.html: <script> func

  • javascript access to the scroll bar height + width and height used js pages [change] 2010-07-06

    /******************** * Get the window scroll bar height ******************/ function getScrollTop () ( var scrollTop = 0; if (document.documentElement & & document.documentElement.scrollTop) ( scrollTop = document.documentElement.scrollTop; ) els

  • Open a new page and the page in a new way to POST the form to send this page 2010-08-20

    Originally thought only to get (url) way to open a new page based on the fact that I am not strong, ignorant. . . <script> function openSpecfiyWindown( windowName ) { window.open('about:blank',windowName,'width=700,height=400,menubar=no,scrollbars=n