Krypton DHTML Library v3.1 Quick Reference


This is your new DHTML Bible, study it, memorize it, laminate it, and for heaven's sake don't lose it!

Kernel.lib
div("div").function() - object handle
div(number position in document)Function() -object handle
divNameObj.function() -object handle
.x() -recall x coordinate
.xReal() -recall actual x coordinate for nested divs
.x(x) -set x coordinate
.y() -recall y coordinate
.yReal() -recall actual y coordinate for nested divs
.y(y) -set y coordinate
.z() -recall z position
.z(z) -set z position
.write("html") -set the inner html for a div 
.move(x,y) -position a div
.width() -recall the width of a div
Width(width) -set the width of a div
.height() -recall the height of a div
Height(height) -set the height of a div
.resize(width,height) -resize a div
.show() -make a div visible
.hide() -hide a div
.toggle() -alternate between visible and hidden
.shown()-returns true if the div is visible, false if it is hidden
.bgColor("color") -set the background color for a div
.bgColor(red,green,blue)-set the background color for a div using rgb model
.clip("t:r:b:l") -recall the clip property for a div
Clip(top,right,bottom,left) -set the clip properties for a div
.contain("child div") -nest a child div inside the parent div
.release("child div") -release a child div from the parent div
.dom -returns the object model for the div for example document.all["div"]
.style -returns the style object for the div for example document.all["div"]Style
lib.divList -returns an array of all divs in the current document
function loaded(){} -executes when the document has loaded and the library has been initialized
function resize(width,height){} -executes when the document is resize
ie -returns true if the browser is Internet Explorer 4.0 or greater
n4 -returns true if the browser is Netscape Navigator 4.x
n6 -returns true if the browser is Netscape Navigator 6.x
lib.browserWidth -returns the width of the browser window
lib.browserHeight -returns the height of the browser window
Slide.lib (Requires kernel.lib)
.slide(x : xArray,y : yArray,increment : incrementArray,speed : speedArray,"command") -slides a div across the screen along a straight line
.slideStop() -stops the slide
.slideResume() -resumes the slide
MoveTo.lib (Requires kernel.lib)
.moveTo(xArray,yArray,speed : speedArray,"command") -moves a div to a series of specified points in succession
.moveStop() -stops the move
.moveResume() -resumes the move
Wipe.lib (Requires kernel.lib)
.wipe(top : topArray,right : rightArray,bottom : bottomArray,left : leftArray,phases : phaseArray,speed : speedArray,"command"); -dynamically changes the clip on a div 
.wipeStop() -stops the wipe
.wipeResume() -resumes the wipe
Events.lib (Requires kernel.lib)
function mouseDown(x,y){} -executes when the mouse is pressed down
function mouseMove(x,y){} -executes when the mouse is moved
function mouseUp(x,y){} -executes when the mouse button comes up
function mouseOver(div){} -executes when the cursor is over a div
function mouseOut(div){} -executes when the cursor leaves a div
function keyDown(ASCII value,"keyboard value"){} -executes when a key is pressed down
function keyUp(ASCII value,"keyboard value"){} -executes when a key comes up
function keyPress(ASCII value,"keyboard value"){} -executes when a key is pressed
.mouseOver("commands") -sets commands to be run when the cursor goes over a div
.mouseOut("commands") -sets commands to be run when the cursor leaves a div
.mouseDown("commands") -sets commands to be run when the mouse is pressed down
.mouseUp("commands") -sets commands to be run when the mouse button comes up
lib.mouseOver("div") -returns true if the cursor is over the specified div 
lib.mouseX -x coordinate for the cursor
lib.mouseY -y coordinate for the cursor
lib.overList -returns an array of divs that the mouse is over
Create.lib (Requires kernel.lib)
create("divname","properties","inner HTML"); -creates a new div
create("divname","properties","inner HTML","Nested Div"); -creates a new nested div
.remove() -remove a div from the document
Scroll.lib (Requires kernel.lib and create.lib)
name=new scrollBox("name") -creates new scrollBox object
name.innerDiv.function() -returns an object to manipulate the inner div
name.outerDiv.function() -returns an object to manipulate the outer div
name.scroll(x,y) -scrolls to the specified coordinates
name.scroll2(x,y) -scrolls using fractional values (between 0.0 and 1.0) of the whole scroll area 
name.left(increment) -scrolls the document at a certain incremental distance
name.right(increment) -scrolls the document at a certain incremental distance
name.down(increment) -scrolls the document at a certain incremental distance
name.up(increment) -scrolls the document at a certain incremental distance
name.stop() -stops the incremental scroll
function scrolling(name,x,y){} -executes when the scroll box is being scrolled
Drag.lib (Requires kernel.lib and events.lib)
.drag() -makes a div draggable
Drag("div") -makes a div draggable within the boundaries of another div
Drag(x,y,width,height) -makes a div draggable within specified boundaries
.dragStatic() -removes draggability from a div
.onTop("divname") -returns true if the current div is on top of the specified div
lib.dragList -returns an array of all divs that are draggable
function dragStart("div being dragged"){} -executes when a div is initially clicked to be dragged
function dragging("div being dragged"){}  -executes when a div is being dragged
function dragStop("div being dragged"){} -executes when a div stops being dragged
loadPage.lib (Requires kernel.lib)
.loadPage("url") -load a page into the current div
function loadedPage("div"){} -executes when a page is loaded into a div

*All coordinate functions, width/height functions, and clip functions will accept NULL values.