|
/* variables */
var objParentObject;
var objobjElement;
var blnDraggable = false;
var intOriginalXOffset;
var intOriginalYOffset;
/* SetHelpDraggable( objElement )
* Allows the help box to be dragged across the
* screen.
*/
function SetHelpDraggable( objElement ) {
/* get the container object */
objParentObject = objElement.parentElement;
while (objParentObject.id=="" && objParentObject != null)
objParentObject = objParentObject.parentElement;
/* set the handle object */
objobjElement = objElement;
blnDraggable = true;
SetOpacity(objParentObject,50);
intOriginalXOffset = window.event.offsetX;
intOriginalYOffset = window.event.offsetY;
}
/* SetHelpFixed()
* Stops the help box from being draggable
*/
function SetHelpFixed() {
SetOpacity(objParentObject,100);
blnDraggable = false;
}
/* SetHelpClosed()
* Closes the help box and makes it invisible
*/
function SetHelpClosed(objElement) {
/* get the container object */
objParentObject = objElement.parentElement;
while (objParentObject.id=="" && objParentObject != null)
objParentObject = objParentObject.parentElement;
if (objParentObject == null) return false;
objParentObject.style.display="none";
}
/* MoveHelp()
* Moves the help box to the current mouse co-ordinates
*/
function MoveHelp() {
if (!(blnDraggable) || objParentObject == null) return;
objParentObject.style.left = GetXCoordinate() - intOriginalXOffset;
objParentObject.style.top = GetYCoordinate() - intOriginalYOffset;
}
/* GetXCoordinate()
* Returns the current X coordinate of the mouse pointer.
*/
function GetXCoordinate() {
return event.clientX + document.body.scrollLeft;
}
/* GetYCoordinate()
* Returns the current Y coordinate of the mouse pointer.
*/
function GetYCoordinate() {
return event.clientY + document.body.scrollTop;
}
/* ShowHelp()
* Display the context sensitive help
*/
function ShowHelp( strPrefix, strTitle, strMessage ) {
var objContainer = document.getElementById(strPrefix + '_csh_container');
var objTitle = document.getElementById(strPrefix + '_csh_Title');
var objHelp = document.getElementById(strPrefix + '_csh_Description');
objContainer.style.display = 'block';
objTitle.innerHTML = strTitle;
objHelp.innerHTML = strMessage;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.