file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
api/window/vrdisplaypresentchange_event/index.md | API - Window - vrdisplaypresentchange event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("vrdisplaypresentchange", (event) => { })
onvrdisplaypresentchange = (event) => { } | [
0.21718108654022217,
-0.452131450176239,
-0.6222275495529175,
1.0749168395996094,
-0.7086851000785828,
-1.4890880584716797,
0.5535139441490173,
1.2693607807159424,
-0.004296794533729553,
0.34212633967399597,
-0.5737711191177368,
0.5985327959060669,
0.11974242329597473,
0.5795004367828369,
... |
api/window/vrdisplaypresentchange_event/index.md | API - Window - vrdisplaypresentchange event - Event type:
A `VRDisplayEvent`. Inherits from `Event`. | [
-0.49590614438056946,
-0.5445008873939514,
-0.09868824481964111,
0.6353558301925659,
-0.7755640149116516,
-0.6033676266670227,
0.4536880552768707,
0.7270097136497498,
0.484189510345459,
0.24064308404922485,
-0.16470475494861603,
0.20986202359199524,
-0.011134643107652664,
0.659606873989105... |
api/window/vrdisplaypresentchange_event/index.md | API - Window - vrdisplaypresentchange event - Examples:
You can use the `vrdisplaypresentchange` event in an `addEventListener` method:
Example:
window.addEventListener("vrdisplaypresentchange", () => {
info.textContent = vrDisplay.isPresenting
? "Display has started presenting."
: "Display has stopped pre... | [
0.15065836906433105,
-0.10643074661493301,
-0.3688504993915558,
1.1090155839920044,
-0.8449293971061707,
-1.467032790184021,
0.3752232789993286,
1.343291163444519,
0.27341902256011963,
0.5060176849365234,
-0.25491490960121155,
0.541869044303894,
0.004391297698020935,
0.5699164867401123,
... |
api/rtcicetransport/getselectedcandidatepair/index.md | API - RTCIceTransport - getSelectedCandidatePair:
The `getSelectedCandidatePair()` method of the `RTCIceTransport` interface returns an `RTCIceCandidatePair` instance containing the current best-choice pair of `ICE` candidates describing the configuration of the endpoints of the transport. | [
-0.5303875803947449,
-0.8956529498100281,
-0.19083772599697113,
1.2912025451660156,
0.23166748881340027,
-1.1592425107955933,
-0.06424172222614288,
0.21226228773593903,
-0.3557319641113281,
-0.08953136950731277,
-0.28341054916381836,
-0.2286621779203415,
0.6149763464927673,
0.7466330528259... |
api/rtcicetransport/getselectedcandidatepair/index.md | API - RTCIceTransport - getSelectedCandidatePair - Syntax:
Example:
getSelectedCandidatePair() | [
-1.402437448501587,
-0.26978352665901184,
0.08180782198905945,
0.900101363658905,
0.26695066690444946,
-1.1523977518081665,
0.16393156349658966,
0.3364964723587036,
-0.8277899622917175,
0.06681522727012634,
-0.40461602807044983,
0.08188040554523468,
-0.2518279254436493,
0.5266784429550171,... |
api/rtcicetransport/getselectedcandidatepair/index.md | API - RTCIceTransport - getSelectedCandidatePair - Syntax - Parameters:
None. | [
-0.7554032206535339,
-0.04932409152388573,
-0.07370497286319733,
0.8470257520675659,
-0.04873849079012871,
-0.5924232602119446,
0.2890474796295166,
0.6260371208190918,
-0.8791072964668274,
-0.42169129848480225,
-0.6738268136978149,
-0.07775400578975677,
0.012506283819675446,
0.609691083431... |
api/rtcicetransport/getselectedcandidatepair/index.md | API - RTCIceTransport - getSelectedCandidatePair - Syntax - Return value:
An `RTCIceCandidatePair` instance describing the configurations of the currently-selected candidate pair's `local` and `remote` endpoints.
The return value is `null` if no pair of candidates has been selected yet. | [
-1.225514531135559,
-0.2299996167421341,
-0.06740809977054596,
1.1266573667526245,
0.1025514304637909,
-0.4577525854110718,
0.4516477584838867,
0.3931021988391876,
-0.7247775197029114,
0.12544438242912292,
-0.3692493140697479,
0.315066933631897,
0.6958907842636108,
0.2872180640697479,
-0... |
api/rtcicetransport/getselectedcandidatepair/index.md | API - RTCIceTransport - getSelectedCandidatePair - Description:
As the ICE agent performs negotiation of a `RTCPeerConnection`, it gathers and analyzes candidate configurations from each of the two peers. As soon as it finds an acceptable matching pair of candidates, meeting the requirements for the connection, a `sel... | [
-0.6539677977561951,
-0.7218864560127258,
-0.4822232723236084,
1.3959335088729858,
0.5299316048622131,
-0.7688612937927246,
0.14739960432052612,
0.7789750695228577,
-0.8567173480987549,
0.7160283923149109,
-0.008783640339970589,
-0.04196612164378166,
0.2637459933757782,
0.7508581876754761,... |
api/rtcicetransport/getselectedcandidatepair/index.md | API - RTCIceTransport - getSelectedCandidatePair - Examples:
See `RTCIceTransport.onselectedcandidatepairchange` for example code. | [
-0.749468982219696,
0.059162795543670654,
-0.024928782135248184,
0.8259775638580322,
0.015092000365257263,
-1.1587934494018555,
0.14934778213500977,
0.22744357585906982,
-1.1506600379943848,
-0.18379488587379456,
0.20069359242916107,
-0.2367946058511734,
0.1901962161064148,
0.3322587013244... |
api/cssnumericvalue/index.md | API - CSSNumericValue:
The `CSSNumericValue` interface of the CSS Typed Object Model API represents operations that all numeric values can perform. | [
-0.38358283042907715,
-0.7150261998176575,
0.016510825604200363,
0.33230361342430115,
0.1043301522731781,
-2.271782159805298,
-0.10489688068628311,
0.07495308667421341,
1.0971657037734985,
0.8446041345596313,
-0.3324410915374756,
0.09734563529491425,
0.7781610488891602,
0.3784276247024536,... |
api/cssnumericvalue/index.md | API - CSSNumericValue - Interfaces based on CSSNumericValue:
Below is a list of interfaces based on the CSSNumericValue interface.
- `CSSMathClamp`
- `CSSMathInvert`
- `CSSMathMax`
- `CSSMathMin`
- `CSSMathNegate`
- `CSSMathProduct`
- `CSSMathSum`
- `CSSMathValue`
- `CSSNumericArray`
- `CSSUnitValue` | [
-0.18387597799301147,
-0.04170655459165573,
-0.7023422122001648,
0.45067912340164185,
-0.02541586011648178,
-2.3824973106384277,
0.0820096880197525,
0.018675416707992554,
0.618844747543335,
0.5992757081985474,
-0.460196852684021,
0.2032453715801239,
0.5160457491874695,
0.07234549522399902,... |
api/cssnumericvalue/index.md | API - CSSNumericValue - Instance properties:
None. | [
-1.182778239250183,
0.7010446786880493,
-0.43559032678604126,
-0.187200665473938,
0.3131551742553711,
-1.8813517093658447,
0.5401513576507568,
0.6037368178367615,
-0.3227640390396118,
0.16932043433189392,
0.08871912956237793,
0.17258009314537048,
0.6127911806106567,
-0.22203120589256287,
... |
api/cssnumericvalue/index.md | API - CSSNumericValue - Static methods:
- `CSSNumericValue.parse`: Allows a `CSSNumericValue` to be constructed directly from a string containing CSS. | [
-0.4912634789943695,
0.1301884800195694,
-0.1082889586687088,
0.18976394832134247,
0.23499077558517456,
-2.2554657459259033,
0.5230993032455444,
0.17365340888500214,
0.24242857098579407,
0.6686123609542847,
-0.32186514139175415,
0.0671057403087616,
0.6571753025054932,
-0.1649819314479828,
... |
api/cssnumericvalue/index.md | API - CSSNumericValue - Instance methods:
- `CSSNumericValue.add`: Adds a supplied number to the `CSSNumericValue`.
- `CSSNumericValue.sub`: Subtracts a supplied number from the `CSSNumericValue`.
- `CSSNumericValue.mul`: Multiplies the `CSSNumericValue` by the supplied value.
- `CSSNumericValue.div`: Divides the `CSS... | [
-0.35032615065574646,
0.2621028423309326,
-0.5946742296218872,
0.4381463825702667,
-0.041171297430992126,
-1.7798495292663574,
0.8991343975067139,
0.9935524463653564,
0.2850516438484192,
0.02432851679623127,
-0.85951167345047,
0.4536396861076355,
0.26571419835090637,
0.29772213101387024,
... |
api/cssnumericvalue/type/index.md | API - CSSNumericValue - type:
The `type()` method of the `CSSNumericValue` interface returns the type of `CSSNumericValue`, one of `angle`, `flex`, `frequency`, `length`, `resolution`, `percent`, `percentHint`, or `time`. | [
-0.8541904091835022,
-0.5325875878334045,
-0.2138344794511795,
0.36624982953071594,
-0.25655895471572876,
-1.6361351013183594,
0.27755385637283325,
0.13495919108390808,
0.49793434143066406,
0.5032066702842712,
-0.20381562411785126,
-0.04358996823430061,
0.574977695941925,
0.351894736289978... |
api/cssnumericvalue/type/index.md | API - CSSNumericValue - type - Syntax:
Example:
type() | [
-0.6588897109031677,
0.1675173044204712,
-0.35040563344955444,
-0.11421391367912292,
-0.22113510966300964,
-1.8926767110824585,
0.35759347677230835,
0.20698149502277374,
-0.2956090569496155,
0.4170500636100769,
0.35530972480773926,
0.527315080165863,
0.326497882604599,
0.058374613523483276... |
api/cssnumericvalue/type/index.md | API - CSSNumericValue - type - Syntax - Parameters:
None. | [
-0.4026998281478882,
0.7845330238342285,
-0.5259250402450562,
-0.04740693047642708,
-0.20548787713050842,
-1.5166287422180176,
1.1615005731582642,
0.6166329383850098,
-0.5225986242294312,
-0.0046653542667627335,
-0.2545205354690552,
-0.31354835629463196,
0.2582409679889679,
0.3367435038089... |
api/cssnumericvalue/type/index.md | API - CSSNumericValue - type - Syntax - Return value:
A `CSSNumericType` dictionary, which contains the following properties:
- `length`
- `angle`
- `time`
- `frequency`
- `resolution`
- `flex`
- `percent`
- `percentHint`
For each property except `percentHint`, the value is an integer representing the power of that ... | [
-0.4952739179134369,
-0.5516882538795471,
-0.4504874646663666,
0.6348854899406433,
-0.04557851329445839,
-1.728223204612732,
1.2564300298690796,
0.5452128052711487,
0.5018897652626038,
0.15478555858135223,
-0.5119338035583496,
0.06861987709999084,
-0.04383547976613045,
-0.03493069112300873... |
api/cssnumericvalue/type/index.md | API - CSSNumericValue - type - Syntax - Exceptions:
None. | [
-0.11095205694437027,
0.09460309892892838,
-0.48063892126083374,
0.06857709586620331,
-0.5834935307502747,
-1.9531971216201782,
0.401267945766449,
0.6620967984199524,
0.08690252900123596,
-0.013952033594250679,
-0.274369478225708,
-0.11985519528388977,
0.009305380284786224,
0.3198712766170... |
api/cssnumericvalue/type/index.md | API - CSSNumericValue - type - Examples - Basic usage:
Example:
let mathSum = CSS.px("23")
.sub(CSS.percent("4"))
.sub(CSS.cm("3"))
.sub(CSS.in("9"));
// Returns an object with the structure: {length: 1, percentHint: "length"}
let cssNumericType = mathSum.type(); | [
-0.5560404062271118,
0.11988115310668945,
-0.7068086266517639,
-0.5674515962600708,
-0.34850382804870605,
-2.0766656398773193,
0.24947234988212585,
0.21114830672740936,
0.07665941119194031,
0.5852797031402588,
-0.3650807738304138,
-0.10830434411764145,
0.05452531576156616,
-0.2165221124887... |
api/cssnumericvalue/mul/index.md | API - CSSNumericValue - mul:
The `mul()` method of the `CSSNumericValue` interface multiplies the `CSSNumericValue` by the supplied value. | [
-0.9732081294059753,
0.16522610187530518,
-0.40435388684272766,
-0.2747468948364258,
-0.31113240122795105,
-2.1073644161224365,
0.7068642377853394,
-0.11953433603048325,
-0.23535773158073425,
0.4095681309700012,
-0.5563911199569702,
-0.45391711592674255,
0.5822919607162476,
0.3482024371623... |
api/cssnumericvalue/mul/index.md | API - CSSNumericValue - mul - Syntax:
Example:
mul(number) | [
-0.9528394937515259,
0.5925824046134949,
-0.34783172607421875,
-0.353083074092865,
-0.5881402492523193,
-2.1215758323669434,
0.7643759250640869,
-0.05923730134963989,
-0.23674538731575012,
0.30727213621139526,
-0.0994812548160553,
0.17669565975666046,
0.4137978255748749,
0.2566156089305877... |
api/cssnumericvalue/mul/index.md | API - CSSNumericValue - mul - Syntax - Parameters:
- `number`: Either a number or a `CSSNumericValue`. | [
-0.4074048101902008,
0.2952198088169098,
-0.2545374631881714,
-0.35218074917793274,
-0.15232743322849274,
-2.080975294113159,
0.12040182948112488,
-0.08847957104444504,
-0.0693008154630661,
0.26266103982925415,
-0.26313871145248413,
-0.2335241585969925,
0.27246198058128357,
0.2873656451702... |
api/cssnumericvalue/mul/index.md | API - CSSNumericValue - mul - Syntax - Return value:
A `CSSMathProduct` | [
-0.3354230523109436,
0.7071453332901001,
-0.2788982391357422,
0.0023903511464595795,
-0.11186681687831879,
-2.08160138130188,
0.5455392599105835,
0.49446725845336914,
-0.36781466007232666,
0.9991512298583984,
-0.06448677182197571,
0.376627117395401,
0.5210174322128296,
-0.19158251583576202... |
api/cssnumericvalue/mul/index.md | API - CSSNumericValue - mul - Syntax - Exceptions:
- `TypeError`: Thrown if an invalid type was passed to the method. | [
-0.7530779242515564,
0.19858555495738983,
-0.17971543967723846,
0.26502612233161926,
-0.4451053738594055,
-1.8227853775024414,
0.11382773518562317,
0.14128665626049042,
-0.06161775439977646,
0.12042726576328278,
-0.41168975830078125,
0.24904310703277588,
0.6259673833847046,
0.3070984482765... |
api/cssnumericvalue/mul/index.md | API - CSSNumericValue - mul - Examples - Basic usage:
Example:
let mathSum = CSS.px("23")
.mul(CSS.percent("4"))
.mul(CSS.cm("3"))
.mul(CSS.in("9"));
// Prints "calc(23px * 4% * 3cm * 9in)"
console.log(mathSum.toString()); | [
-0.9474605321884155,
0.43695980310440063,
-0.5335761308670044,
-0.4824490249156952,
-0.3564639985561371,
-1.587040901184082,
0.3649328947067261,
-0.22059579193592072,
0.06128917634487152,
0.2399362325668335,
-0.669033408164978,
0.165403813123703,
0.07919704169034958,
0.27391067147254944,
... |
api/cssnumericvalue/min/index.md | API - CSSNumericValue - min:
The `min()` method of the `CSSNumericValue` interface returns the lowest value from among those values passed. The passed values must be of the same type. | [
-0.7653489112854004,
0.008926626294851303,
-0.8124663829803467,
0.22070354223251343,
-0.02153860777616501,
-2.1740336418151855,
0.20363569259643555,
-0.20035003125667572,
0.17520293593406677,
0.3572390079498291,
-0.6534852385520935,
0.2562330365180969,
0.5261624455451965,
0.512258052825927... |
api/cssnumericvalue/min/index.md | API - CSSNumericValue - min - Syntax:
Example:
min(number1, /* …, */ numberN) | [
-0.9131359457969666,
0.4343034327030182,
-0.27119824290275574,
-0.07804302871227264,
0.054774507880210876,
-1.3616629838943481,
0.13695016503334045,
-0.18416251242160797,
-0.5120381116867065,
0.3818560838699341,
-0.16880424320697784,
0.16666162014007568,
-0.22946467995643616,
0.06995883584... |
api/cssnumericvalue/min/index.md | API - CSSNumericValue - min - Syntax - Parameters:
- `number1`, …, `numberN`: Either a number or a `CSSNumericValue`. | [
-0.0561850480735302,
0.032048895955085754,
-0.3159972131252289,
-0.18643517792224884,
-0.03942856937646866,
-2.099484443664551,
0.3999250829219818,
-0.21284262835979462,
0.08976811170578003,
0.36984947323799133,
-0.25695711374282837,
-0.03314949572086334,
-0.10233788937330246,
0.0966560393... |
api/cssnumericvalue/min/index.md | API - CSSNumericValue - min - Syntax - Return value:
A `CSSUnitValue`. | [
-0.18140622973442078,
0.5546281933784485,
-0.7653854489326477,
0.005871184170246124,
-0.2241077423095703,
-2.386749267578125,
0.3506305515766144,
-0.09806729108095169,
-0.832271933555603,
0.3356172442436218,
0.17137411236763,
0.1888633668422699,
0.6412152051925659,
0.3135318458080292,
-0... |
api/cssnumericvalue/min/index.md | API - CSSNumericValue - min - Syntax - Exceptions:
- `TypeError`: Thrown if an invalid type was passed to the method. | [
-0.5970999598503113,
-0.08479337394237518,
-0.6342862844467163,
0.4313242733478546,
-0.2676161229610443,
-2.2079017162323,
0.3475090563297272,
0.4093402922153473,
-0.003375694155693054,
0.22528187930583954,
-0.34270384907722473,
0.42882174253463745,
0.35928598046302795,
0.28153491020202637... |
api/cssnumericvalue/min/index.md | API - CSSNumericValue - min - Examples - Basic usage:
As stated earlier, all passed values must be of the same type and value. Some of the following examples illustrate what happens when they are not.
Example:
// Prints "1cm"
console.log(CSS.cm("1").min(CSS.cm("2")).toString());
// Prints "max(1cm, 0.393701in)"
con... | [
-0.2374432235956192,
-0.3420584499835968,
-1.177051305770874,
0.5610577464103699,
-0.22856421768665314,
-1.413872480392456,
-0.3495383560657501,
-0.24492451548576355,
0.5171290636062622,
-0.16948875784873962,
-0.49205702543258667,
0.6504493951797485,
0.4314202666282654,
-0.0126542598009109... |
api/cssnumericvalue/tosum/index.md | API - CSSNumericValue - toSum:
The `toSum()` method of the `CSSNumericValue` interface converts the object's value to a `CSSMathSum` object to values of the specified unit. | [
-0.488491415977478,
0.3383391797542572,
-0.7039415240287781,
0.17540910840034485,
0.019424982368946075,
-2.4273998737335205,
0.1258116066455841,
-0.04726346582174301,
-0.19588716328144073,
0.15144097805023193,
-0.562040388584137,
-0.1106923371553421,
0.5020476579666138,
-0.0281642265617847... |
api/cssnumericvalue/tosum/index.md | API - CSSNumericValue - toSum - Syntax:
Example:
toSum(units) | [
-0.2587946057319641,
0.6347582936286926,
-0.5348841547966003,
-0.07105758786201477,
-0.12817156314849854,
-2.378713607788086,
0.28612855076789856,
0.029529821127653122,
-0.38120636343955994,
0.2098238617181778,
-0.008400769904255867,
0.39662620425224304,
0.018232975155115128,
-0.0807369202... |
api/cssnumericvalue/tosum/index.md | API - CSSNumericValue - toSum - Syntax - Parameters:
- `units`: The units to convert to. | [
0.5614986419677734,
1.1092398166656494,
-0.6703565120697021,
0.24889573454856873,
-0.15587547421455383,
-2.4489166736602783,
0.05274836719036102,
0.12658482789993286,
-0.7453520894050598,
-0.008525626733899117,
-0.8531198501586914,
0.14930053055286407,
-0.4041515588760376,
0.15477286279201... |
api/cssnumericvalue/tosum/index.md | API - CSSNumericValue - toSum - Syntax - Return value:
A `CSSMathSum`. | [
0.48820099234580994,
0.6270034313201904,
-0.4984350800514221,
-0.4017269015312195,
-0.30174005031585693,
-1.9544107913970947,
0.16170378029346466,
0.04104875028133392,
-0.47001105546951294,
0.577420711517334,
-0.37303853034973145,
0.37902364134788513,
0.3001142740249634,
0.2604849934577942... |
api/cssnumericvalue/tosum/index.md | API - CSSNumericValue - toSum - Syntax - Exceptions:
- `TypeError`: Thrown if an invalid type was passed to the method. | [
0.09193139523267746,
0.21779605746269226,
-0.3894473910331726,
0.16070137917995453,
-0.3636563718318939,
-2.205512762069702,
0.041721269488334656,
0.23102617263793945,
-0.1665325164794922,
0.25179123878479004,
-0.5153350234031677,
0.45229965448379517,
0.12873795628547668,
0.104135215282440... |
api/cssnumericvalue/tosum/index.md | API - CSSNumericValue - toSum - Examples - Basic usage:
Example:
let v = CSS.px("23").add(CSS.percent("4")).add(CSS.cm("3")).add(CSS.in("9"));
v.toString(); // => "calc(23px + 4% + 3cm + 9in)"
v.toSum("px", "percent").toString(); // => "calc(1000.39px + 4%)" | [
-0.8551982641220093,
0.048354849219322205,
-0.3459133207798004,
-0.0032599717378616333,
-0.11979734897613525,
-1.3125141859054565,
0.06441307812929153,
-0.27088630199432373,
0.5683441758155823,
-0.010721305385231972,
-0.6119363307952881,
0.3739559054374695,
-0.05814453959465027,
0.26846513... |
api/cssnumericvalue/max/index.md | API - CSSNumericValue - max:
The `max()` method of the `CSSNumericValue` interface returns the highest value from among the values passed. The passed values must be of the same type. | [
-0.416398823261261,
-0.29399925470352173,
-0.7888859510421753,
0.2705259621143341,
-0.14161032438278198,
-1.7650701999664307,
0.23922374844551086,
0.41829055547714233,
0.09448413550853729,
0.24099890887737274,
0.03399285674095154,
0.26914164423942566,
0.4568016231060028,
0.2790960371494293... |
api/cssnumericvalue/max/index.md | API - CSSNumericValue - max - Syntax:
Example:
max(number1, /* …, */ numberN) | [
-0.4642796814441681,
0.21816067397594452,
-0.4669925570487976,
-0.051783543080091476,
-0.31123512983322144,
-1.7848389148712158,
0.0848625972867012,
0.06662365794181824,
-0.1874411553144455,
0.3058899939060211,
0.14626657962799072,
0.5218609571456909,
-0.16425356268882751,
-0.0587876029312... |
api/cssnumericvalue/max/index.md | API - CSSNumericValue - max - Syntax - Parameters:
- `number1`, …, `numberN`: Either a number or a `CSSNumericValue`. | [
0.16679607331752777,
0.06411569565534592,
-0.21149511635303497,
-0.13387912511825562,
-0.11408339440822601,
-1.946582555770874,
0.287967324256897,
0.009856298565864563,
0.1762089729309082,
0.0774349719285965,
-0.3134956359863281,
0.151700958609581,
-0.006608380004763603,
-0.077910773456096... |
api/cssnumericvalue/max/index.md | API - CSSNumericValue - max - Syntax - Return value:
A `CSSUnitValue`. | [
0.1603364497423172,
0.6515408158302307,
-0.6686919331550598,
0.19484148919582367,
-0.49135980010032654,
-2.3750717639923096,
0.23678448796272278,
0.22440281510353088,
-0.739738941192627,
0.43090641498565674,
0.27252671122550964,
0.20403310656547546,
0.32337382435798645,
0.41686591506004333... |
api/cssnumericvalue/max/index.md | API - CSSNumericValue - max - Syntax - Exceptions:
- `TypeError`: Thrown if an invalid type was passed to the method. | [
-0.3115987777709961,
-0.14695507287979126,
-0.5989193916320801,
0.3670547306537628,
-0.2951630651950836,
-1.8656569719314575,
0.13331462442874908,
0.43149206042289734,
0.06110838055610657,
0.04192807152867317,
-0.3966952860355377,
0.7272075414657593,
0.5985643863677979,
0.14400935173034668... |
api/cssnumericvalue/max/index.md | API - CSSNumericValue - max - Examples - Basic usage:
As stated earlier, all passed values must be of the same type and value. Some of the following examples illustrate what happens when they are not.
Example:
// Prints "2cm"
console.log(CSS.cm("1").max(CSS.cm("2")).toString());
// Prints "max(1cm, 0.393701in)"
con... | [
-0.18559576570987701,
-0.32148241996765137,
-1.0320446491241455,
0.754747211933136,
-0.3949407935142517,
-1.1506575345993042,
-0.4874085783958435,
-0.06877794861793518,
0.7148194313049316,
-0.27179110050201416,
-0.3791952431201935,
0.7766238451004028,
0.4904458522796631,
-0.104076161980628... |
api/cssnumericvalue/sub/index.md | API - CSSNumericValue - sub:
The `sub()` method of the `CSSNumericValue` interface subtracts a supplied number from the `CSSNumericValue`. | [
-0.38257747888565063,
0.2783382534980774,
-0.8866000771522522,
0.13346578180789948,
-0.0031583085656166077,
-2.640566825866699,
0.5025190114974976,
0.5903874635696411,
-0.25710028409957886,
0.6217228770256042,
-0.1262427568435669,
-0.2634315490722656,
0.3139497935771942,
0.7544444799423218... |
api/cssnumericvalue/sub/index.md | API - CSSNumericValue - sub - Syntax:
Example:
sub(number) | [
-0.5174893736839294,
0.823383092880249,
-0.542878270149231,
-0.2197357714176178,
-0.4011150598526001,
-2.286241292953491,
0.3149248957633972,
0.5267656445503235,
-0.3818739354610443,
0.15692922472953796,
0.48956620693206787,
0.18063361942768097,
0.1474204659461975,
0.5823415517807007,
-0... |
api/cssnumericvalue/sub/index.md | API - CSSNumericValue - sub - Syntax - Parameters:
- `number`: Either a number or a `CSSMathSum`. | [
0.09897946566343307,
0.37174490094184875,
-0.7656475305557251,
-0.5464549660682678,
0.005856379866600037,
-2.5281553268432617,
0.2556077241897583,
0.21756897866725922,
-0.015005946159362793,
0.15179948508739471,
-0.23592537641525269,
0.15839454531669617,
0.03368397802114487,
0.067501589655... |
api/cssnumericvalue/sub/index.md | API - CSSNumericValue - sub - Syntax - Return value:
A `CSSMathSum` | [
-0.05846327915787697,
0.6202352046966553,
-0.30305513739585876,
-0.2629627585411072,
-0.37552833557128906,
-2.339292049407959,
0.652432918548584,
0.4263315200805664,
-0.23681758344173431,
0.4447958171367645,
0.020178627222776413,
0.36207592487335205,
0.1866842806339264,
0.01806785166263580... |
api/cssnumericvalue/sub/index.md | API - CSSNumericValue - sub - Syntax - Exceptions:
- `TypeError`: Thrown if an invalid type was passed to the method. | [
-0.3964363932609558,
-0.030882513150572777,
-0.4566745460033417,
0.3127506375312805,
-0.3035883903503418,
-2.4533491134643555,
-0.015590434893965721,
0.6110868453979492,
0.187339186668396,
0.04980725422501564,
-0.19055579602718353,
0.35192447900772095,
0.5906915664672852,
0.158786296844482... |
api/cssnumericvalue/sub/index.md | API - CSSNumericValue - sub - Examples - Basic usage:
Example:
let mathSum = CSS.px("23")
.sub(CSS.percent("4"))
.sub(CSS.cm("3"))
.sub(CSS.in("9"));
// Prints "calc(23px - 4% - 3cm - 9in)"
console.log(mathSum.toString()); | [
-0.30042314529418945,
0.34047719836235046,
-0.8805482983589172,
-0.37743180990219116,
-0.2395218014717102,
-1.7422080039978027,
0.24031737446784973,
-0.19621403515338898,
-0.13750261068344116,
0.26091641187667847,
-0.24982301890850067,
0.29009556770324707,
-0.07835328578948975,
-0.06584424... |
api/cssnumericvalue/parse_static/index.md | API - CSSNumericValue - parse static:
The `parse()` static method of the `CSSNumericValue` interface converts a value string into an object whose members are value and the units. | [
-0.4569525420665741,
0.20455102622509003,
-0.7740353345870972,
0.5249509811401367,
0.2730523645877838,
-2.3458540439605713,
0.8335742950439453,
0.7927279472351074,
-0.10300780832767487,
0.24237032234668732,
0.007698345929384232,
0.1532992571592331,
0.7821881771087646,
0.6182240843772888,
... |
api/cssnumericvalue/parse_static/index.md | API - CSSNumericValue - parse static - Syntax:
Example:
CSSNumericValue.parse(cssText) | [
-0.595000684261322,
0.785167396068573,
-0.09942144900560379,
0.18763108551502228,
-0.09479770809412003,
-2.342421770095825,
0.7298117876052856,
0.5396379232406616,
-0.41577622294425964,
0.35295209288597107,
0.1814049482345581,
0.49565714597702026,
0.24610984325408936,
0.581874430179596,
... |
api/cssnumericvalue/parse_static/index.md | API - CSSNumericValue - parse static - Syntax - Parameters:
- `cssText`: a string containing numeric and unit parts. | [
-0.5411271452903748,
0.36861902475357056,
-0.3246612548828125,
0.2131507396697998,
-0.02346249669790268,
-2.532193183898926,
0.3858967125415802,
0.11896368861198425,
0.011520691215991974,
0.529744029045105,
-0.019634585827589035,
0.016946397721767426,
0.01907552033662796,
0.014043964445590... |
api/cssnumericvalue/parse_static/index.md | API - CSSNumericValue - parse static - Syntax - Return value:
A `CSSNumericValue`. | [
0.004749908111989498,
0.024146705865859985,
-0.3986923396587372,
-0.2983097732067108,
-0.4728586971759796,
-2.0254299640655518,
0.41879943013191223,
0.2422161102294922,
-0.46128687262535095,
0.5511529445648193,
-0.2652864456176758,
0.1552284061908722,
0.5871334671974182,
0.2643398344516754... |
api/cssnumericvalue/parse_static/index.md | API - CSSNumericValue - parse static - Syntax - Exceptions:
- `SyntaxError` `DOMException`: TBD | [
-0.34113624691963196,
-0.09072069078683853,
-0.37158435583114624,
-0.1767570823431015,
-0.10178297013044357,
-1.7750060558319092,
0.20871803164482117,
-0.43346071243286133,
0.5288739800453186,
0.0806095153093338,
-0.002139035612344742,
0.6903752684593201,
-0.08264632523059845,
-0.010585386... |
api/cssnumericvalue/parse_static/index.md | API - CSSNumericValue - parse static - Examples - Basic usage:
The following code returns a `CSSUnitValue` object with a `unit` property equal to `"px"` and a `value` property equal to `42`.
Example:
let numValue = CSSNumericValue.parse("42.0px"); | [
-0.541046679019928,
0.1375919133424759,
-0.9453417658805847,
0.2965846657752991,
0.010994285345077515,
-1.9012930393218994,
0.6541427969932556,
0.12004923820495605,
-0.21277011930942535,
-0.22775202989578247,
0.023188002407550812,
0.2421516478061676,
0.33615487813949585,
0.0228188335895538... |
api/cssnumericvalue/div/index.md | API - CSSNumericValue - div:
The `div()` method of the `CSSNumericValue` interface divides the `CSSNumericValue` by the supplied value. | [
-0.44045278429985046,
-0.2221958339214325,
-0.5928544402122498,
0.09453019499778748,
-0.23737874627113342,
-1.9309629201889038,
0.6697748899459839,
0.2856135666370392,
-0.17731299996376038,
0.41178712248802185,
-0.06444583833217621,
-0.07497309893369675,
0.6672238707542419,
0.4473696947097... |
api/cssnumericvalue/div/index.md | API - CSSNumericValue - div - Syntax:
Example:
div(number) | [
-0.7818350195884705,
-0.036473847925662994,
-0.46550753712654114,
-0.4202423095703125,
-0.3418518304824829,
-1.732452630996704,
0.7402927279472351,
0.24250102043151855,
-0.19516324996948242,
0.5032272338867188,
0.28829365968704224,
0.4175015091896057,
-0.07336480915546417,
0.20713391900062... |
api/cssnumericvalue/div/index.md | API - CSSNumericValue - div - Syntax - Parameters:
- `number`: Either a number or a `CSSNumericValue`. | [
0.13554316759109497,
0.09451942145824432,
-0.3430502414703369,
-0.24387076497077942,
-0.09043610841035843,
-2.3361403942108154,
0.6294829845428467,
0.30971530079841614,
-0.10635089874267578,
0.21699516475200653,
0.05066265910863876,
-0.04344487935304642,
0.20886172354221344,
0.443773627281... |
api/cssnumericvalue/div/index.md | API - CSSNumericValue - div - Syntax - Return value:
A `CSSMathProduct`. | [
-0.16319803893566132,
0.41813594102859497,
-0.4614027440547943,
0.2003471702337265,
-0.04665176570415497,
-1.8523966073989868,
0.24489864706993103,
0.6333523988723755,
-0.6076595187187195,
1.0721925497055054,
-0.2255631387233734,
0.3474515378475189,
0.17539004981517792,
-0.0218033753335475... |
api/cssnumericvalue/div/index.md | API - CSSNumericValue - div - Syntax - Exceptions:
- `TypeError`: Thrown if an invalid type was passed to the method. | [
-0.6611788272857666,
-0.14335811138153076,
-0.5192217826843262,
0.17536617815494537,
-0.13280215859413147,
-2.2981388568878174,
0.35519957542419434,
0.7505749464035034,
-0.08250896632671356,
0.1780458390712738,
-0.08548112213611603,
0.38489094376564026,
0.21182206273078918,
0.3370674848556... |
api/cssnumericvalue/div/index.md | API - CSSNumericValue - div - Examples - Basic usage:
Example:
let mathProduct = CSS.px("24").div(CSS.percent("4"));
// Prints "calc(24px / 4%)"
mathProduct.toString(); | [
-0.8609368801116943,
-0.03052956610918045,
-0.5088425874710083,
-0.2094121277332306,
0.031233660876750946,
-1.3675872087478638,
0.33244824409484863,
0.41370612382888794,
-0.06174683943390846,
0.4703979790210724,
-0.3686104118824005,
0.08065125346183777,
0.008312523365020752,
0.084000647068... |
api/cssnumericvalue/add/index.md | API - CSSNumericValue - add:
The `add()` method of the `CSSNumericValue` interface adds a supplied number to the `CSSNumericValue`. | [
-0.0940503180027008,
-0.009940528310835361,
-0.7259129881858826,
-0.1327693611383438,
-0.04780414700508118,
-2.410398006439209,
0.5915018916130066,
0.6769052743911743,
-0.3469359576702118,
0.4546903073787689,
-0.37352925539016724,
0.05928944796323776,
0.10607701539993286,
0.665211379528045... |
api/cssnumericvalue/add/index.md | API - CSSNumericValue - add - Syntax:
Example:
add(number) | [
-0.2814548909664154,
0.38703465461730957,
-0.6921187043190002,
-0.2806083559989929,
-0.6012308597564697,
-2.121346950531006,
0.6608899235725403,
0.15445680916309357,
-0.3109523057937622,
0.3551267087459564,
-0.359201580286026,
0.1820858120918274,
-0.25282445549964905,
0.3719273805618286,
... |
api/cssnumericvalue/add/index.md | API - CSSNumericValue - add - Syntax - Parameters:
- `number`: Either a number or a `CSSNumericValue`. | [
0.4765523374080658,
0.03735095262527466,
-0.61015385389328,
-0.2081090658903122,
-0.2707444727420807,
-2.348576307296753,
0.4840579628944397,
0.26422423124313354,
-0.010242439806461334,
0.2060105949640274,
-0.4395381212234497,
-0.0828123539686203,
0.20119649171829224,
0.27438583970069885,
... |
api/cssnumericvalue/add/index.md | API - CSSNumericValue - add - Syntax - Return value:
A `CSSMathSum` | [
0.25607821345329285,
0.45963308215141296,
-0.40508878231048584,
-0.21654151380062103,
-0.2604522705078125,
-2.0487093925476074,
0.7216649651527405,
0.22679007053375244,
-0.21332110464572906,
0.5587146878242493,
-0.2679067552089691,
0.32082459330558777,
0.10262501239776611,
-0.1870035082101... |
api/cssnumericvalue/add/index.md | API - CSSNumericValue - add - Syntax - Exceptions:
- `TypeError`: Thrown if an invalid type was passed to the method. | [
-0.32189205288887024,
-0.08270041644573212,
-0.43371421098709106,
0.5313129425048828,
-0.38127171993255615,
-1.9714139699935913,
0.1144527941942215,
0.4211370348930359,
0.26292183995246887,
0.07517211139202118,
-0.33506354689598083,
0.4409253001213074,
0.3846357762813568,
0.280462235212326... |
api/cssnumericvalue/add/index.md | API - CSSNumericValue - add - Examples - Basic usage:
Example:
let mathSum = CSS.px("23")
.add(CSS.percent("4"))
.add(CSS.cm("3"))
.add(CSS.in("9"));
// Prints "calc(23px + 4% + 3cm + 9in)"
console.log(mathSum.toString()); | [
-0.15283125638961792,
0.24784982204437256,
-0.8384012579917908,
-0.35415926575660706,
-0.36508259177207947,
-1.2039705514907837,
-0.016071081161499023,
-0.029331156983971596,
0.1818505823612213,
0.06673993170261383,
-0.4658541977405548,
0.3927236795425415,
0.06424053758382797,
0.0018557719... |
api/cssnumericvalue/equals/index.md | API - CSSNumericValue - equals:
The `equals()` method of the `CSSNumericValue` interface returns a boolean indicating whether the passed values are strictly equal. To return a value of `true`, all passed values must be of the same type and value and must be in the same order. This allows structural equality to be test... | [
-0.7317211031913757,
0.3946319818496704,
-0.5931747555732727,
0.7846779823303223,
-0.21436631679534912,
-2.62037992477417,
0.6810386180877686,
0.4523634910583496,
0.1664533019065857,
0.112395279109478,
-0.30295833945274353,
0.18391086161136627,
0.7176729440689087,
0.2849912643432617,
-0.... |
api/cssnumericvalue/equals/index.md | API - CSSNumericValue - equals - Syntax:
Example:
equals(number) | [
-0.5398485660552979,
0.5544931888580322,
-0.8418529629707336,
-0.39377155900001526,
-0.2625938653945923,
-2.3332254886627197,
0.32258129119873047,
0.19726645946502686,
-0.24268563091754913,
0.33657118678092957,
0.24256521463394165,
0.15242651104927063,
0.150912806391716,
0.1116917133331298... |
api/cssnumericvalue/equals/index.md | API - CSSNumericValue - equals - Syntax - Parameters:
- `number`: Either a number or a `CSSNumericValue`. | [
0.20500968396663666,
0.34007778763771057,
-0.5038759112358093,
-0.03864273801445961,
-0.07233261317014694,
-2.6263034343719482,
0.39604195952415466,
0.024807970970869064,
-0.11861252784729004,
0.16565671563148499,
-0.1510656476020813,
-0.08935072273015976,
0.24861913919448853,
0.2336453199... |
api/cssnumericvalue/equals/index.md | API - CSSNumericValue - equals - Syntax - Return value:
A boolean value. | [
-0.37088635563850403,
0.5475456118583679,
-0.7660190463066101,
0.1090848296880722,
-0.5573763847351074,
-2.029324769973755,
0.6835404634475708,
0.3617313504219055,
-0.42175787687301636,
0.2907373905181885,
-0.2777746319770813,
0.3348601758480072,
0.49471765756607056,
0.03374575823545456,
... |
api/cssnumericvalue/equals/index.md | API - CSSNumericValue - equals - Syntax - Exceptions:
None. | [
-0.14098988473415375,
0.4696961045265198,
-0.7326381206512451,
0.024435460567474365,
-0.535264790058136,
-2.380650043487549,
0.6940077543258667,
0.5039728879928589,
-0.19980302453041077,
-0.10082560777664185,
-0.1989840567111969,
0.07391269505023956,
-0.23200251162052155,
0.633415043354034... |
api/cssnumericvalue/equals/index.md | API - CSSNumericValue - equals - Examples - Basic usage:
As stated earlier, all passed values must be of the same type and value and must be in the same order. Some of the following examples illustrate what happens when they are not.
Example:
let cssMathSum = new CSSMathSum(CSS.px(1), CSS.px(2));
let matchingCssMath... | [
0.28119346499443054,
-0.25066664814949036,
-1.2243900299072266,
0.34812062978744507,
-0.2094123363494873,
-1.7682198286056519,
-0.23331154882907867,
-0.21714827418327332,
0.24991220235824585,
0.21456830203533173,
-0.187021404504776,
0.12194463610649109,
0.4035007953643799,
0.05451025813817... |
api/cssnumericvalue/to/index.md | API - CSSNumericValue - to:
The `to()` method of the `CSSNumericValue` interface converts a numeric value from one unit to another. | [
-0.15526644885540009,
0.38369494676589966,
-0.5791522860527039,
0.4611009359359741,
-0.0518903024494648,
-2.481973171234131,
0.01329214870929718,
0.6053169369697571,
0.12183935940265656,
0.24276690185070038,
-0.06317176669836044,
0.02150847762823105,
0.5342894196510315,
0.5413323044776917,... |
api/cssnumericvalue/to/index.md | API - CSSNumericValue - to - Syntax:
Example:
to(unit) | [
-0.2851395905017853,
0.31673598289489746,
-0.3934820294380188,
0.21242493391036987,
-0.26733386516571045,
-2.4776320457458496,
0.33626776933670044,
0.06846250593662262,
-0.4608922302722931,
0.12282469123601913,
0.05079405754804611,
0.23222863674163818,
0.17573010921478271,
-0.1604485362768... |
api/cssnumericvalue/to/index.md | API - CSSNumericValue - to - Syntax - Parameters:
- `unit`: The unit to which you want to convert. | [
-0.1130932942032814,
1.0144627094268799,
-0.6991649270057678,
0.3484703004360199,
0.1440020054578781,
-2.2050607204437256,
0.5553224086761475,
0.5989163517951965,
-0.7929854393005371,
0.0023794984444975853,
-0.1341651976108551,
0.2780047357082367,
0.039728544652462006,
0.4914020895957947,
... |
api/cssnumericvalue/to/index.md | API - CSSNumericValue - to - Syntax - Return value:
A `CSSUnitValue`. | [
0.04717627540230751,
0.8046346306800842,
-0.5567594766616821,
-0.1608404517173767,
-0.3734032213687897,
-2.398700714111328,
0.35835400223731995,
0.14485862851142883,
-0.9276701807975769,
0.4678495228290558,
0.20810310542583466,
0.18749231100082397,
0.4710172414779663,
0.5590866208076477,
... |
api/cssnumericvalue/to/index.md | API - CSSNumericValue - to - Syntax - Exceptions:
- `SyntaxError` `DOMException`: Thrown if an invalid unit was passed to the method.
- `TypeError`: Thrown if:
- The `CSSNumericValue` on which the method is being called can't be resolved to a single value and type. This might occur if the value is calculated from a ... | [
0.048246826976537704,
-0.34127283096313477,
-0.2742856740951538,
0.6939114928245544,
-0.16358858346939087,
-2.4872841835021973,
-0.16819223761558533,
0.8525989055633545,
0.8927434086799622,
0.363675057888031,
-0.41512438654899597,
0.3652217388153076,
0.5777456164360046,
0.1666944921016693,... |
api/cssnumericvalue/to/index.md | API - CSSNumericValue - to - Examples - Basic usage:
Example:
// Prints "0.608542cm"
console.log(CSS.px("23").to("cm").toString()); | [
-0.48649051785469055,
0.2368602752685547,
-0.7687706351280212,
-0.5545611381530762,
-0.5082381963729858,
-2.505476951599121,
-0.1600797176361084,
-0.587213933467865,
-0.26972776651382446,
-0.06606516987085342,
-0.24981245398521423,
1.020524024963379,
0.5696146488189697,
-0.3890267610549927... |
api/htmlformelement/formdata_event/index.md | API - HTMLFormElement - formdata event:
The `formdata` event fires after the entry list representing the form's data is constructed. This happens when the form is submitted, but can also be triggered by the invocation of a `FormData()` constructor.
This event is not cancelable and does not bubble. | [
-0.6051073670387268,
0.03955809399485588,
-0.07126552611589432,
0.21293678879737854,
-0.11141163110733032,
-1.8152916431427002,
0.7320975065231323,
1.6622105836868286,
-0.6778321266174316,
0.039829153567552567,
-0.4242868721485138,
0.8291993141174316,
0.2807162404060364,
0.2807022929191589... |
api/htmlformelement/formdata_event/index.md | API - HTMLFormElement - formdata event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("formdata", (event) => { })
onformdata = (event) => { } | [
-0.05785803869366646,
-0.3920622766017914,
-0.02069661021232605,
0.3803291916847229,
-0.2561592161655426,
-1.343529462814331,
-0.040751706808805466,
0.476158082485199,
-0.1863638311624527,
-0.2733118534088135,
-0.7692972421646118,
0.8380321264266968,
0.2635621428489685,
0.16491366922855377... |
api/htmlformelement/formdata_event/index.md | API - HTMLFormElement - formdata event - Event type:
A `FormDataEvent`. Inherits from `Event`. | [
-0.5897992253303528,
-0.37414559721946716,
0.0527665838599205,
-0.1015462875366211,
-0.5563095211982727,
-0.9822076559066772,
-0.03156910464167595,
0.6859572529792786,
-0.30513495206832886,
-0.3032430112361908,
-0.316039502620697,
0.7769960761070251,
0.06938496977090836,
0.4629721641540527... |
api/htmlformelement/formdata_event/index.md | API - HTMLFormElement - formdata event - Examples:
Example:
// grab reference to form
const formElem = document.querySelector("form");
// submit handler
formElem.addEventListener("submit", (e) => {
// on form submission, prevent default
e.preventDefault();
console.log(formElem.querySelector('input[name="fie... | [
-0.18312665820121765,
-0.16655690968036652,
0.3000398874282837,
0.08197124302387238,
0.10171370208263397,
-0.7354886531829834,
0.34876778721809387,
0.7327350378036499,
-0.11705024540424347,
0.4093182682991028,
-0.5167153477668762,
0.3937087655067444,
-0.029927494004368782,
0.21721142530441... |
api/htmlformelement/submit_event/index.md | API - HTMLFormElement - submit event:
The `submit` event fires when a `form` is submitted.
Note that the `submit` event fires on the `<form>` element itself, and not on any `button` or ``<input type="submit">`` inside it. However, the `SubmitEvent` which is sent to indicate the form's submit action has been tri... | [
-0.6491155624389648,
0.10325291752815247,
0.41528698801994324,
0.42361485958099365,
0.062482595443725586,
-1.2664726972579956,
0.8576221466064453,
0.5338480472564697,
-0.367887407541275,
0.43525394797325134,
-0.28285956382751465,
0.10400667786598206,
0.18678832054138184,
-0.086341068148612... |
api/htmlformelement/submit_event/index.md | API - HTMLFormElement - submit event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("submit", (event) => { })
onsubmit = (event) => { } | [
-0.8403997421264648,
0.38512739539146423,
0.4201045334339142,
0.13608933985233307,
0.06396108865737915,
-0.7369500398635864,
0.09523051977157593,
0.09063903987407684,
-0.2189565896987915,
-0.19050979614257812,
-0.5069889426231384,
0.7145174145698547,
0.6217246055603027,
0.10509516298770905... |
api/htmlformelement/submit_event/index.md | API - HTMLFormElement - submit event - Event type:
A `SubmitEvent`. Inherits from `Event`. | [
-0.6925932765007019,
0.30251723527908325,
0.41080808639526367,
0.1653214991092682,
-0.3806682229042053,
-0.7212131023406982,
-0.1531684547662735,
0.44137051701545715,
-0.5180440545082092,
-0.23593494296073914,
0.16768819093704224,
0.822749137878418,
0.2650282680988312,
0.32053142786026,
... |
api/htmlformelement/submit_event/index.md | API - HTMLFormElement - submit event - Examples:
This example uses `EventTarget.addEventListener()` to listen for form submit, and logs the current `Event.timeStamp` whenever that occurs, then prevents the default action of submitting the form. | [
-0.724210798740387,
0.13727125525474548,
0.20992976427078247,
0.2642136216163635,
-0.20991668105125427,
-1.1718775033950806,
0.8390350341796875,
0.2175275832414627,
-0.20976942777633667,
-0.03161193057894707,
-0.27034661173820496,
0.5018582344055176,
0.29694557189941406,
0.1480254232883453... |
api/htmlformelement/submit_event/index.md | API - HTMLFormElement - submit event - Examples - HTML:
Example:
<form id="form">
<label>Test field: <input type="text" /></label>
<br /><br />
<button type="submit">Submit form</button>
</form>
<p id="log"></p> | [
-0.8607228994369507,
0.22115157544612885,
0.44176363945007324,
-0.20976053178310394,
0.019238442182540894,
-1.16666579246521,
0.5581129789352417,
-0.3336155116558075,
-0.4795895218849182,
0.22513414919376373,
-0.6891666054725647,
0.41223376989364624,
0.6189016103744507,
0.27085229754447937... |
api/htmlformelement/submit_event/index.md | API - HTMLFormElement - submit event - Examples - JavaScript:
Example:
const form = document.getElementById("form");
const log = document.getElementById("log");
function logSubmit(event) {
log.textContent = `Form Submitted! Timestamp: ${event.timeStamp}`;
event.preventDefault();
}
form.addEventListener("submit"... | [
-0.509369432926178,
-0.13618426024913788,
-0.08519233763217926,
-0.04436298459768295,
-0.35056984424591064,
-1.171690821647644,
-0.22748228907585144,
-0.049432702362537384,
-0.5357636213302612,
-0.1438300758600235,
-0.8572268486022949,
0.2805884778499603,
0.13027600944042206,
0.03728875517... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API:
Secure context: This feature is available only in secure contexts (HTTPS).
The Screen Wake Lock API provides a way to prevent devices from dimming or locking the screen when an application needs to keep running. | [
0.1620987355709076,
0.1561707854270935,
-0.2060897797346115,
-0.049949999898672104,
0.12812893092632294,
-1.3105427026748657,
-0.8165179491043091,
0.6261517405509949,
0.8250996470451355,
-0.1511879712343216,
-0.3337634801864624,
0.16469255089759827,
-0.21031704545021057,
0.0660893544554710... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Concepts and usage:
Most devices by default turn off their screen after a specified amount of time to prolong the life of the hardware. Modern devices do this to save on battery power. While this is a useful feature, some applications need the screen to stay awake to be their most useful.
... | [
1.1499109268188477,
0.5001998543739319,
-0.8692211508750916,
-0.13319435715675354,
0.3658696115016937,
-0.9798906445503235,
0.058931998908519745,
1.3244662284851074,
-0.20945404469966888,
-0.06968206912279129,
-0.06397099792957306,
0.6915613412857056,
-0.025064993649721146,
0.7011042237281... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Interfaces:
- `WakeLock`: Prevents device screens from dimming or locking when an application needs to keep running.
- `WakeLockSentinel`: Provides a handle to the underlying platform wake lock and if referenced can be manually released and reacquired. Get an instance of the object by call... | [
0.7137219309806824,
0.7864726185798645,
-0.7264605760574341,
-0.4613310694694519,
-0.5450856685638428,
-1.405318021774292,
-0.3206205666065216,
0.48638683557510376,
0.9906879663467407,
-0.1924513280391693,
-0.486153244972229,
-0.20979316532611847,
-0.3057253360748291,
0.649657130241394,
... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Interfaces - Extensions to other interfaces:
- `Navigator.wakeLock` (read only): Returns a `WakeLock` object instance, from which all other functionality can be accessed.
- `Permissions-Policy: screen-wake-lock`: Access to the API is gated by the `Permissions-Policy` directive `screen-wake... | [
0.6282337307929993,
-0.41343456506729126,
-0.49114587903022766,
0.07489797472953796,
-0.8886778354644775,
-1.5115572214126587,
-0.06860576570034027,
0.5174993872642517,
0.6278801560401917,
-0.2283622771501541,
0.094370037317276,
-0.42274942994117737,
0.00034602731466293335,
0.3999277949333... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Examples - Feature detection:
This code checks for wake lock support and updates the UI accordingly.
Example:
if ("wakeLock" in navigator) {
isSupported = true;
statusElem.textContent = "Screen Wake Lock API supported!";
} else {
wakeButton.disabled = true;
statusElem.textContent... | [
0.6804642677307129,
-0.2272675484418869,
-0.36294323205947876,
-0.0953650176525116,
-0.4127959907054901,
-1.3578169345855713,
-0.37509918212890625,
1.3032244443893433,
-0.06000574678182602,
0.20869605243206024,
0.024965528398752213,
0.1280745565891266,
0.24051663279533386,
0.39793643355369... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Examples - Requesting a wake lock:
The following example demonstrates how to request a `WakeLockSentinel` object. The `WakeLock.request` method is `Promise`-based and so we can create an asynchronous function, which in turn updates the UI to reflect the wake lock is active.
Example:
// C... | [
0.5707920789718628,
0.945380687713623,
0.018285643309354782,
-0.6586565375328064,
-0.29611390829086304,
-0.8639078736305237,
-0.571298360824585,
0.729121744632721,
0.451876163482666,
-0.3057835102081299,
-0.19703909754753113,
-0.20922593772411346,
-0.10589314252138138,
0.5231877565383911,
... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Examples - Releasing wake lock:
The following example shows how to release the previously acquired wake lock.
Example:
wakeLock.release().then(() => {
wakeLock = null;
}); | [
0.121707022190094,
0.8210360407829285,
-0.9014964699745178,
-0.27226629853248596,
-0.23560160398483276,
-0.6637914776802063,
-0.17790475487709045,
0.9533434510231018,
0.8893870711326599,
-0.32944539189338684,
-0.5996139645576477,
0.07354317605495453,
-0.4245477616786957,
0.2862026691436767... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Examples - Listening for wake lock release:
This example updates the UI if the wake lock has been released for any reason (such as navigating away from the active window/tab).
Example:
wakeLock.addEventListener("release", () => {
// the wake lock has been released
statusElem.textCont... | [
0.2574170231819153,
0.3037058115005493,
-0.45821648836135864,
-0.3188580274581909,
-0.19600918889045715,
-1.1928317546844482,
-0.7104549407958984,
1.014423131942749,
0.9012703895568848,
-0.3470281958580017,
-0.22107483446598053,
-0.07681679725646973,
-0.667293131351471,
0.2395631968975067,... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Examples - Reacquiring a wake lock:
The following code reacquires the wake lock should the visibility of the document change and the wake lock is released.
Example:
document.addEventListener("visibilitychange", async () => {
if (wakeLock !== null && document.visibilityState === "visibl... | [
0.4370588958263397,
0.6409414410591125,
-0.14994138479232788,
-0.596953809261322,
-0.40747329592704773,
-0.564203679561615,
-0.38626980781555176,
1.1956254243850708,
0.7915999889373779,
0.07854506373405457,
-0.3621498942375183,
-0.153977170586586,
-0.3428070545196533,
0.5811817646026611,
... |
api/screen_wake_lock_api/index.md | API - Screen Wake Lock API - Examples - Putting it all together:
You can find the complete code on GitHub here. The demo uses a button to acquire a wake lock and also release it, which in turn updates the UI. The UI also updates if the wake lock is released automatically for any reason. There's a checkbox which when c... | [
0.27034303545951843,
0.3609400689601898,
-0.1559557020664215,
-0.5060416460037231,
-0.294864296913147,
-1.1228597164154053,
-1.0217392444610596,
1.2113968133926392,
0.9239943027496338,
-0.2620752453804016,
-0.2571830153465271,
-0.22272750735282898,
-0.0724329948425293,
0.4461458921432495,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.