Wellcome to Ylib Page!
Ylib is a self-made library
of JavaScript functions for making cross-browser DHTML pages. I've created
Ylib for personal purposes, therefore it's very simple and somewhat optimized
for my programming style.
Ylib is free. You are wellcome to use it for non-commercial
purposes, but you should insert a reference to this page: http://www.oocities.org/yesint3/ylib.htm
.
Initialization
-
Just include the ylib.js file:
<script src="ylib.js"></script>
Ylib Functions
-
ShowHide(DivName,action)
- Shows or hides DHTML layer in any brouser. You should pass layer name
and action as strings. Layer name must be sent without document['bla-bla'].bla-bla-bla,
just a name. Function will generate the correct reference. Actions are
'show' and 'hide' (in lower case).
Example:
<div id="MyDiv" style="position:
absolute; left: 100; top: 100; width: 100">
This is a layer.
<a href=#
onClick="ShowHide('MyDiv','hide')">
Click to hide it! </a>
</div>
<a href=# onClick="ShowHide('MyDiv','show')">
Click to show it again! </a>
-
moveTo(DivName,x,y)
- Moves a layer to specified position with the coordinates x and y.
Example:
<a href=# onClick="moveTo('MyDiv',500,300)">
Move it somewhere! </a>
-
getX(DivName)
- Returns left propertie of the given layer.
-
getY(DivName)
- Returns top propertie of the given layer.
Example:
<a href=# onClick="moveTo('MyDiv',2*getX('MyDiv'),2*getY('MyDiv'))">
Move it diagonally! </a>
-
setZIndex(DivName,z)
- Set zIndex property of the given layer to z.
-
ref(DivName)
- Return correct reference to the layer in any browser.
Example:
<a href=# onClick="ref('MyDiv').width=20">
Make it narrow! </a>
Ylib is revised now to work with NS6. Download will be available later.
Actually the code of my home page now contains all the old Ylib functions in the
script section along with custom animation functions wich use them. See the code
if you are interested or contact me.
© Semen Yesylevskyy, 2001.
Home
Page
e-mail me comments/sujestions about Ylib