js in the top, left, height, width parameters and examples of analytic

The following analysis of these parameters are directed to the IE browser:

Get screen coordinates of the mouse, as opposed to the entire page:
x = event.clientX, y = event.clientY

Be the width of the current window:
w = document.body.clientWidth;
h = document.body.clientHeight;
In html, if <! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> This is not deleted, then the height is not to be

True.

Work area can be used screen height, width:
h = window.screen.availHeight;
w = window.screen.availWidth;

The total screen height, width:
h = window.screen.height;
w = window.screen.width;

Left:

Examples:

<div>
  <div> If you have set up for p  
scrollTopeeeeeeeeewrfdsfsddf These  , These contents may not be fully displayed.  </div>
</div>
<script type="text/javascript">
var p = document.getElementById("p");
var t= document.getElementById("t");
p.scrollLeft =50;
</script>

divLeft = p.style.Left that p is defined in the style of the value of the left, which were not defined so empty

divClientLeft = p.clientLeft said border width p of p.clientLeft = 2
divScrollLeft = p.scrollLeft that p and can be seen the top of the content of the distance between the top, then t in the left side of the hidden characters will 50px

offsetLeft examples:

<script language="javascript">
function tt(){
	var testObj=document.getElementById("test");
	var toptest=document.getElementById("toptest");
	var test1=document.getElementById("test1");
}
</script>
<body onload="tt()">
<div>   
<div></div>
</div> 
<div />

divOffsetLeft = objDiv.offsetLeft that the div relative to the parent object's distance from the left side of toptest.offsetLeft = 20
testObj.offsetLeft = 10 test1.offsetLeft = 10

top:

divTop = objDiv.style.top that the definition of div in the style of the top of the value, otherwise empty
divClientTop = objDiv.clientTop that the border width of div

divOffsetTop = objDiv.offsetTop that the div relative to the height of the parent object.

scrollTop examples:

<div>
  <div> If you have set up for p  

scrollTop That may not be fully displayed.  </div>
</div>
<script type="text/javascript">
var p = document.getElementById("p");
p.scrollTop = 20;
</script>


divScrollTOp = objDiv.scrollTop that the top div and the content can be seen from the top of the previous examples show that if you set the outer layer of the p element scrollTop, the inner layer of the element then the content will be up "up."

width:

Example code:

<div >
  <div> If you set for p  
dfdddddddd These contents may not be fully displayed.  </div>
</div>
<script type="text/javascript">
var p = document.getElementById("p");
var t= document.getElementById("t");
</script>

divWidth = p.style.width that the definition of div in the style of the height of the value of 200px
divScrollWidth = p.scrollWidth that the actual height of the page content. Elements for the actual height of the inner + outer elements of padding 300
divClientWidth = p.clientWidth if div is a single-width-border-scroll bars, that is, the height of div visible region,

However, if included in the relationship between the inner elements are higher than the outer elements, compared to the original height of 200. And t.clientWidth = 250. So it does not contain his own
equivalent to divOffsetWidth = p.offsetWidth results clientHeight + border + scrollbar p.offsetWidth = 204 and
t.clientWidth = 254

height Example:

<div >
  <div> If you set for p  
dfdddddddd These contents may not be fully displayed.  </div>
</div>
<script type="text/javascript">
var p = document.getElementById("p");
</script>

divHeight = p.style.height that the definition of div in the style of the height of the value of 200px
divScrollHeight = p.scrollHeight that the actual height of the page content. Elements for the actual height of the inner + outer elements of padding 300
divClientHeight = p.clientHeight if div is a single-height-border-scroll bars, that is, the height of div visible region

However, if there is inclusion, then the inner layer of the element is higher than the outer elements, compared to the original height of 200
equivalent to divOffsetHeight = p.offsetHeight results clientHeight + border + scrollbar 204

  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of js in the top, left, height, width parameters and examples of analytic

  • Hibernate primary key strategy-sequence

    Today, the use of hibernate in the company encountered a troublesome problem, the use of hibernate when the primary key generation strategy set sequence, but always reported in the implementation could not get next sequence value of the error, then o ...

  • hibernate call stored procedure

    hibernate call stored procedure

  • hibernate using c3p0 connection pooling

    Private http://www.lifevv.com/tenyo/doc/20070605102040991.html c3p0 for open source's JDBC connection pool, with the release hibernate. This article describes how to use the hibernate configuration in c3p0. c3p0 connection pool configuration is v ...

  • Hibernate configuration parameters hibernate.hbm2ddl.auto

    Hibernate in the configuration file: <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...

  • Build flex + spring + blazeds + hibernate application

    Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis ...

  • Hibernate connection pool configuration

    Hibernate connection pool configuration <! - Jdbc -> <property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property> <property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.1 ...

  • hibernate generic generic DAO

    hibernate generic generic DAO

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

  • Hibernate's lazy strategy

    hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...

Leave a Reply

Recent
Recent Entries
Tag Cloud
Random Entries