Site Navigation
VegUISiteKit - The Window Functions Library
written by vegu on 15 Mar, 2007 07:23:21
The window functions library was made for one reason and that reason is cross-browser access to certain attributes of the window object. The problem is - depending on doctype - that internet explorer uses the documentElement or the body element to retrieve certain attributes while the other browsers get them directly from the window object.
As i write this little tutorial [Thursday 15th March, 2007] the window functions library has 4 functions , two functions to retrieve the scroll offset of the screen and two to retrieve it's inner height and width.
To retrieve inner-width and inner-height of the screen - which is the actual area of the browser that the page is displayed in - you can use the
vsk_iw() and
vsk_ih functions.
Example:alert('Inner Screen Width: '+vsk_iw());
alert('Inner Screen Height: '+vsk_ih());
The scroll offsets are retrieved by the
vsk_ox() and
vsk_oy() functions.
Example:alert('Scroll X Offset:' + vsk_ox());
alert('Scroll Y Offset:' + vsk_oy());
The scroll offset tells you how much a users has scrolled the page on the x or y axis.
I add stuff to the window functions library as i need it and will update this tutorial with additional explanations should the need arise, so check back.
Related Posts
Your Comment
Comments
No comments yet.