XMPP JavaScript Library

Some useful Java Script Expressions

JavaScript, Sachin Puri, 2012-01-05 18:09:25

To get size of visible area of HTML page

window.innerHeight

window.innerWidth

document.body.clientHeight

document.body.clientWidth

document.documentElement.clientHeight

document.documentElement.clientWidth

 

To get height - width of user screen

screen.height

screen.width

To get height - width of HTML document

document.body.scrollHeight

document.body.scrollWidth

Set opacity of a HTML element using JavaScript

document.getElementById('<id-of-element>').style.MozOpacity=.80

document.getElementById('<id-of-element>').style.opacity=.5

document.getElementById('<id-of-element>').style.filter="alpha(opacity = 50)";

Remove HTML Document Scroll bars

document.body.style.overflow="hidden"

Get Size of and HTML Element

document.getElementById('<id-of-element>').clientHeight

document.getElementById('<id-of-element>').clientWidth

Delete or Remove an element from HTML Document

document.body.removeChild(document.getElementById('<id-of-element>'))

 

Add Your Comment
   
    Yes! I want to receive all comments by email

No Comments Posted Yet. Be the first one to post comment