lightoff()

Syntax:

[void] sysinfo.lightoff(String lighttarget, Int duration, Int fadeout)

Description:

The lightoff method switches the specified target light off for the specified duration.

Argument:

  • lighttarget:

    Defines which target light should be turned off. Use one of the supported target light properties to specify a target light.

  • duration:

    Defines the period during which the target light is switched off. The period is measured in milliseconds.

    After the duration expires, the light state of the target will be changed to whatever state was caused by the last infinite time duration call. If there has not been a previous infinite time duration call in a session, the default state determined by the inactivity timer (system backlight timeout) is used.

    If duration is lightinfiniteduration, the target light can be turned on only when some other light control method is called.

  • fadeout:

    If true, target lights will not turn off instantly but fade-out smoothly instead. If false, target lights will be turned off immediately.

Note: All devices might not support fade-out, in which case the device will behave in its default manner.

Return value:

This method does not return a value.

Example code:

function callLightOff()
{
   // get the Embed element reference
   var sysinfo = document.embeds[0];
   /*********************
   call lightoff() method, which turns off the light 
   of all displays and keyboard for 5 seconds of duration 
   and using fading out mode
   *********************/
   var target =  sysinfo.lighttargetsystem;
   var duration = 5000; // 5 seconds
   sysinfo.lightoff(target, duration, true);
}