Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

chargingtimechange

Nuestros voluntarios aún no han traducido este artículo al Español. Únete a nosotros y ayúdanos a traducirlo

The chargingtimechange event is fired when the chargingTime attribute of the battery API has changed.

General info

Specification
Battery
Interface
Event
Bubbles
No
Cancelable
No
Target
BatteryManager
Default Action
None

Properties

The event callback doesn't receive any event objects, but properties can be read from the BatteryManager object received from the navigator.getBattery method.

Property Type Description
BatteryManager.chargingTime double (float) The remaining time in seconds until the system's battery is fully charged. Returns 0 if the battery is fully charged. Returns positive infinity, if the battery is discharging or if the implementation is unable to report the remaining charging time. Read only.

Example

navigator.getBattery().then(function(battery) {

  console.log("Battery charging time: " + battery.chargingTime + " seconds");

  battery.addEventListener('chargingtimechange', function() {
    console.log("Battery charging time: " + battery.chargingTime + " seconds");
  });

});

Etiquetas y colaboradores del documento

Etiquetas: 
 Colaboradores en esta página: fscholz, franciov, teoli, Sheppy, ethertank, louisremi
 Última actualización por: fscholz,