SetDurationPickerPosition
If implemented, overrides the size and position functionality of the duration window for the DurationSelector server control.
Syntax
function SetDurationPickerPosition(oDiv)
Parameters
- oDiv
- Type: Object
The <div> element that represents the DurationSelector server control.
Remarks
If this JavaScript function is implemented for a configuration page, the DurationSelector control invokes the function when the control is shown, specifying the <div> element that represents the control in oDiv. The function can then interact with the specified <div> element to configure the display characteristics, such as the size and position, of the duration window for the control.
Example
The following example demonstrates how to implement the SetDurationPickerPosition function to display the duration window for the DurationSelector control in the center of the configuration page.
function SetDurationPickerPosition(oDiv) { var windowWidth = document.body.offsetWidth; var windowHeight = document.body.offsetHeight; var widthOfDiv = parseInt(oDiv.style.width); var heightOfDiv = parseInt(oDiv.style.height); var leftPos = (windowWidth - widthOfDiv) / 2; var topPos = (windowHeight - heightOfDiv) / 2; oDiv.style.left = leftPos + "px"; oDiv.style.top = topPos + "px"; }