file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
api/window/scrollby/index.md | API - Window - scrollBy - Examples - Basic usage:
To scroll down one page:
Example:
window.scrollBy(0, window.innerHeight);
To scroll up:
Example:
window.scrollBy(0, -window.innerHeight);
Using `options`:
Example:
window.scrollBy({
top: 100,
left: 100,
behavior: "smooth",
}); | [
-0.774635374546051,
0.6454363465309143,
-0.4784638583660126,
0.470359742641449,
-0.39877328276634216,
-1.1015745401382446,
0.24355167150497437,
0.3622273802757263,
-0.1061767041683197,
0.0011557871475815773,
-0.3528839647769928,
-0.2292390763759613,
0.5146703720092773,
0.06664041429758072,... |
api/window/scrollby/index.md | API - Window - scrollBy - Examples - Responding to the end of the scroll:
Our window methods demo (see source code) demonstrates how the promise return value of `scrollBy()` can be used to respond to the end of a scrolling operation. This technique is mostly useful in cases where the scrolling occurs smoothly over tim... | [
-0.8152619004249573,
-0.02432490885257721,
-0.4901449382305145,
0.49637407064437866,
-0.22323645651340485,
-1.286263108253479,
0.5748310089111328,
0.9395411014556885,
0.24468597769737244,
0.6957773566246033,
0.07162328064441681,
0.46874773502349854,
0.9830855131149292,
0.8117451071739197,
... |
api/window/scrollby/index.md | API - Window - scrollBy - Examples - Responding to the end of the scroll - HTML:
Our HTML includes several paragraphs of content and a `div` element toolbar containing `button` elements that trigger various scrolling operations on the window.
Example:
<div>
<button class="scroll">scroll() to 1000</button>
<butto... | [
-1.415929913520813,
-0.23656532168388367,
-0.013079487718641758,
0.7555448412895203,
-0.20266249775886536,
-0.8868239521980286,
-0.07738182693719864,
0.17878244817256927,
-0.23951652646064758,
0.6354641914367676,
-0.08962847292423248,
-0.05341964587569237,
0.16205523908138275,
0.4051824808... |
api/window/scrollby/index.md | API - Window - scrollBy - Examples - Responding to the end of the scroll - CSS:
We give the `:root` element a `scroll-behavior` property value of `smooth` so that any scroll operations are animated smoothly over time rather than instantly.
Example:
:root {
scroll-behavior: smooth;
}
We also create two class selec... | [
-0.5614876747131348,
-0.5398507714271545,
-0.13745760917663574,
0.2861284911632538,
0.4104996919631958,
-1.5695382356643677,
0.45500490069389343,
0.9054968953132629,
-0.21892669796943665,
0.7737349271774292,
0.1598958671092987,
-0.7452974915504456,
0.31214243173599243,
0.009034618735313416... |
api/window/scrollby/index.md | API - Window - scrollBy - Examples - Responding to the end of the scroll - JavaScript:
We start by grabbing references to the `<button>` that runs the `scrollBy()` operation and the toolbar `<div>`:
Example:
const scrollByBtn = document.querySelector(".scroll-by");
const toolbar = document.querySelector("div");
Nex... | [
-0.5335076451301575,
-0.09603364765644073,
-0.2768496572971344,
0.22454550862312317,
0.17290917038917542,
-0.6814608573913574,
-0.05716826021671295,
0.9174339771270752,
0.2556327283382416,
0.5719953775405884,
-0.4434768259525299,
0.21511590480804443,
-0.16836728155612946,
0.187340021133422... |
api/window/scrollby/index.md | API - Window - scrollBy - Examples - Responding to the end of the scroll - Aside on feature detection:
If you run this example in a browser that doesn't support promise-returning scroll operations, the scroll operations are still smooth, but the toolbar doesn't fade out and then fade back in once the operation is fini... | [
-0.20488910377025604,
-0.00350973941385746,
-0.46898460388183594,
0.7948143482208252,
0.5223883986473083,
-1.3809856176376343,
-0.08593308925628662,
0.9365002512931824,
0.2764771580696106,
0.5778891444206238,
-0.22068658471107483,
-0.4537452161312103,
0.5019696950912476,
0.3522663414478302... |
api/window/blur_event/index.md | API - Window - blur event:
The `blur` event fires when an element has lost focus.
The opposite of `blur` is `focus`.
This event is not cancelable and does not bubble. | [
-0.894270122051239,
0.2256702035665512,
0.28779658675193787,
-0.09707561135292053,
-0.2743547260761261,
-1.4668599367141724,
0.15786325931549072,
0.4048053026199341,
0.18289941549301147,
0.338859885931015,
-0.4588390588760376,
-0.14209067821502686,
-0.05561833456158638,
1.1137036085128784,... |
api/window/blur_event/index.md | API - Window - blur event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("blur", (event) => { })
onblur = (event) => { } | [
0.20865431427955627,
0.21905428171157837,
-0.04412878304719925,
0.0047796331346035,
-0.18984103202819824,
-1.6704390048980713,
0.033202625811100006,
0.6067098379135132,
0.4958854913711548,
0.19622120261192322,
-0.47616463899612427,
0.40279433131217957,
-0.4149923324584961,
0.35652485489845... |
api/window/blur_event/index.md | API - Window - blur event - Event type:
A `FocusEvent`. Inherits from `UIEvent` and `Event`. | [
-0.35539954900741577,
-0.018556689843535423,
-0.5593015551567078,
-0.3529965877532959,
-0.5053446888923645,
-0.4616079032421112,
-0.42885923385620117,
0.49266451597213745,
-0.10760147869586945,
0.14623317122459412,
0.34095364809036255,
0.47690272331237793,
0.06984034180641174,
0.7166033387... |
api/window/blur_event/index.md | API - Window - blur event - Examples - Live example:
This example changes the appearance of a document when it loses focus. It uses `addEventListener()` to monitor `focus` and `blur` events. | [
-0.4684179723262787,
-0.006409936584532261,
0.20498496294021606,
0.16955554485321045,
-0.7606165409088135,
-1.1946601867675781,
0.5554817914962769,
0.6709607839584351,
0.27544912695884705,
0.5188438296318054,
-0.030400509014725685,
0.6519601941108704,
0.055384255945682526,
0.73954486846923... |
api/window/blur_event/index.md | API - Window - blur event - Examples - Live example - HTML:
Example:
<p id="log">Click on this document to give it focus.</p> | [
-0.3500511646270752,
0.05338752269744873,
0.11392423510551453,
-0.16666047275066376,
-0.615044891834259,
-1.3990896940231323,
0.6568719148635864,
0.15773460268974304,
-0.456513911485672,
0.5633721351623535,
-0.3003782629966736,
0.9377895593643188,
0.2714086174964905,
0.6815435290336609,
... |
api/window/blur_event/index.md | API - Window - blur event - Examples - Live example - CSS:
Example:
.paused {
background: #dddddd;
color: #555555;
} | [
-0.4674593210220337,
0.14210164546966553,
0.007907114923000336,
-0.9986588358879089,
-0.3315287232398987,
-0.5663837194442749,
0.28230220079421997,
0.303720086812973,
-0.6678260564804077,
0.671336829662323,
0.2731579840183258,
-0.01644313335418701,
0.10782557725906372,
0.599587619304657,
... |
api/window/blur_event/index.md | API - Window - blur event - Examples - Live example - JavaScript:
Example:
const log = document.getElementById("log");
function pause() {
document.body.classList.add("paused");
log.textContent = "FOCUS LOST!";
}
function play() {
document.body.classList.remove("paused");
log.textContent =
"This document... | [
-0.4114627242088318,
-0.1387813240289688,
-0.5699160695075989,
-0.07033111900091171,
-0.3257021903991699,
-1.17909836769104,
0.4900267720222473,
0.4346703588962555,
-0.08204173296689987,
0.20622621476650238,
-0.4890780746936798,
0.13532894849777222,
-0.18320655822753906,
0.3151347935199737... |
api/window/beforeinstallprompt_event/index.md | API - Window - beforeinstallprompt event:
The `beforeinstallprompt` event fires when the browser has detected that a website can be installed as a Progressive Web App.
There's no guaranteed time this event is fired, but it usually happens on page load.
The typical use for this event is when a web app wants to provid... | [
0.010154208168387413,
-0.8830341696739197,
-0.2285192459821701,
0.3587419390678406,
-0.1750730574131012,
-1.2727736234664917,
-0.6664412617683411,
0.371953547000885,
0.8354545831680298,
0.6467494964599609,
0.08304784446954727,
0.13657908141613007,
0.11077040433883667,
0.18238864839076996,
... |
api/window/beforeinstallprompt_event/index.md | API - Window - beforeinstallprompt event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("beforeinstallprompt", (event) => { })
onbeforeinstallprompt = (event) => { } | [
0.09941133856773376,
-0.10950296372175217,
-0.682256817817688,
1.0235495567321777,
-0.5766668319702148,
-2.087090253829956,
0.3743079900741577,
0.8667826056480408,
0.03876826912164688,
0.7114765048027039,
-0.41595378518104553,
0.4167957901954651,
0.04810963571071625,
0.09954361617565155,
... |
api/window/beforeinstallprompt_event/index.md | API - Window - beforeinstallprompt event - Event type:
A `BeforeInstallPromptEvent`. Inherits from `Event`. | [
-0.6252967715263367,
-0.2674919068813324,
-0.14656253159046173,
0.6021288633346558,
-0.7814106941223145,
-1.5651135444641113,
0.15662628412246704,
0.5801200866699219,
0.833682656288147,
0.46226781606674194,
-0.1632968634366989,
0.494484543800354,
-0.20202182233333588,
0.3904036283493042,
... |
api/window/beforeinstallprompt_event/index.md | API - Window - beforeinstallprompt event - Event methods:
- `BeforeInstallPromptEvent.prompt()` (non-standard) (experimental): Show a prompt asking the user if they want to install the app. This method returns a `Promise` that resolves to an object describing the user's choice when they were prompted to install the ap... | [
-0.6012008190155029,
-0.33773714303970337,
-0.18507498502731323,
0.13252513110637665,
-0.3351665735244751,
-1.8775590658187866,
0.19141113758087158,
0.43507906794548035,
0.2354223132133484,
0.9980698227882385,
-0.7411608695983887,
0.34538573026657104,
-0.0066758375614881516,
0.439523637294... |
api/window/beforeinstallprompt_event/index.md | API - Window - beforeinstallprompt event - Examples:
In the following example an app provides its own install button, which has an `id` of `"install"`. Initially the button is hidden.
Example:
<button id="install" hidden>Install</button>
The `beforeinstallprompt` handler:
- Cancels the event, which prevents the br... | [
0.01803162693977356,
-0.4745407700538635,
-0.24218307435512543,
0.6190874576568604,
-0.5836564302444458,
-1.995471477508545,
-0.21972660720348358,
0.4556277394294739,
0.8005430102348328,
0.58775395154953,
-0.5418227314949036,
0.2648153305053711,
-0.1329449564218521,
0.039815083146095276,
... |
api/window/message_event/index.md | API - Window - message event:
The `message` event is fired on a `Window` object when the window receives a message, for example from a call to `Window.postMessage()` from another browsing context.
This event is not cancellable and does not bubble. | [
-0.43021655082702637,
0.45879748463630676,
0.12943361699581146,
0.09272703528404236,
0.14764665067195892,
-1.4840270280838013,
0.20912869274616241,
1.1657438278198242,
-0.17619828879833221,
0.14151060581207275,
0.09581075608730316,
-0.028956223279237747,
0.4170225262641907,
0.5026090741157... |
api/window/message_event/index.md | API - Window - message event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("message", (event) => { })
onmessage = (event) => { } | [
0.14228194952011108,
-0.06941485404968262,
0.06516002118587494,
-0.395327627658844,
0.07173418998718262,
-1.3164831399917603,
0.1915162056684494,
0.861294686794281,
0.3364526331424713,
-0.31006351113319397,
-0.33931252360343933,
0.5155311822891235,
0.008512519299983978,
0.1653757244348526,... |
api/window/message_event/index.md | API - Window - message event - Event type:
A `MessageEvent`. Inherits from `Event`. | [
-0.17898553609848022,
-0.10917046666145325,
-0.07755954563617706,
-0.7224050164222717,
-0.3808656632900238,
-1.0905156135559082,
-0.021073080599308014,
0.7218242287635803,
0.46271848678588867,
-0.16690954566001892,
0.10316601395606995,
-0.013168226927518845,
0.2218809723854065,
0.428546726... |
api/window/message_event/index.md | API - Window - message event - Examples:
Suppose a script sends a message to a different browsing context, such as another `<iframe>`, using code like this:
Example:
const targetFrame = window.top.frames[1];
const targetOrigin = "https://example.org";
const windowMessageButton = document.querySelector("#window-messa... | [
0.29768162965774536,
-0.038666725158691406,
-0.20764264464378357,
0.07232637703418732,
0.38143390417099,
-1.5547990798950195,
0.018494710326194763,
0.5138771533966064,
0.0485873818397522,
0.4767480790615082,
0.06251050531864166,
0.12015718221664429,
-0.0435623973608017,
0.38513585925102234... |
api/window/requestresize/index.md | API - Window - requestResize:
The `requestResize()` method of the `Window` interface updates the size information shared by an embedded document with its embedding parent, but only if the embedded document has opted in to sharing its size information via the `<meta name="responsive-embedded-sizing">` meta tag. | [
-0.10719098895788193,
0.2607244551181793,
-0.2215152084827423,
0.27268823981285095,
-0.43588510155677795,
-2.131746530532837,
0.34088200330734253,
0.2960089147090912,
-0.12162655591964722,
0.006247481796890497,
-0.6859087944030762,
0.4070616662502289,
0.24127817153930664,
0.480530560016632... |
api/window/requestresize/index.md | API - Window - requestResize - Syntax:
Example:
requestResize() | [
-0.09775081276893616,
0.3544677197933197,
-0.2113984078168869,
-0.31639304757118225,
-0.8813714385032654,
-0.7628694772720337,
0.8078855872154236,
0.5326778888702393,
-0.06641592085361481,
0.23580606281757355,
-0.3141670823097229,
0.636280357837677,
-0.3359801471233368,
0.3260478973388672,... |
api/window/requestresize/index.md | API - Window - requestResize - Syntax - Parameters:
None. | [
-0.1527152955532074,
0.4439578950405121,
-0.35250595211982727,
-0.1684698611497879,
-0.4279812276363373,
-0.5797551274299622,
0.7053888440132141,
0.9013411402702332,
-0.44582220911979675,
-0.08330891281366348,
-0.6818448901176453,
0.15700355172157288,
-0.30029138922691345,
0.64324384927749... |
api/window/requestresize/index.md | API - Window - requestResize - Syntax - Return value:
None (`undefined`). | [
-0.6655637621879578,
0.2022760510444641,
-0.2222318798303604,
-0.8049734830856323,
-0.5612127780914307,
-0.5259571075439453,
0.18083585798740387,
0.9435319900512695,
-0.22120964527130127,
0.009622922167181969,
-0.4418897330760956,
0.10005220770835876,
0.14374808967113495,
0.650514185428619... |
api/window/requestresize/index.md | API - Window - requestResize - Syntax - Exceptions:
- `NotAllowedError` `DOMException`: Thrown if:
- The `requestResize()` method was called from a top-level (non-embedded) document.
- The embedding element is not an `iframe`.
- The embedded document has not opted in to sharing its layout size by including a `<m... | [
0.2465442270040512,
-0.5448604822158813,
-0.120601125061512,
-0.08802688866853714,
-0.30215972661972046,
-1.601837158203125,
-0.08232569694519043,
1.0624127388000488,
-0.5341492891311646,
0.26717954874038696,
-0.5173026323318481,
0.4924474358558655,
-0.024790607392787933,
0.110396131873130... |
api/window/requestresize/index.md | API - Window - requestResize - Description:
For security and privacy reasons, `iframe` elements do not by default expose any information to the parent document about the size of the content in the document they are embedding.
To enable responsive sizing of `<iframe>` elements based on their content, the `<meta name="... | [
0.6448230147361755,
-0.261610746383667,
-0.4881334602832794,
-0.42032498121261597,
0.05001804232597351,
-0.8189152479171753,
0.6256318092346191,
1.2724905014038086,
-0.635009765625,
0.18247736990451813,
-0.14190122485160828,
0.7596380710601807,
-0.8745513558387756,
0.5718867182731628,
-1... |
api/window/requestresize/index.md | API - Window - requestResize - Examples - Using `requestResize()`:
This example shows how the `requestResize()` method can be used to automatically resize an `<iframe>` when the layout size of its embedded document content changes.
We have two documents, the main `index.html` document, and the embedded `frame.html` d... | [
-0.3365635275840759,
0.14207732677459717,
-0.32431966066360474,
-0.03740625083446503,
-0.27319109439849854,
-1.144518256187439,
0.3977210819721222,
0.6069832444190979,
-0.4720029830932617,
0.37455126643180847,
-0.5654029250144958,
0.6115348935127258,
0.36040347814559937,
0.0471749603748321... |
api/window/requestresize/index.md | API - Window - requestResize - Examples - Using `requestResize()` - The main `index.html`:
The `index.html` document's HTML contains a heading and an `<iframe>`, into which is embedded the `frame.html` document:
Example:
<h1>Responsive iframes — basic example</h1>
<iframe src="frame.html"></iframe>
In the `index.h... | [
-0.16805756092071533,
-0.4114593267440796,
0.23473680019378662,
0.5184761881828308,
0.16001668572425842,
-1.5277479887008667,
0.6575985550880432,
0.058811284601688385,
-0.1446104347705841,
0.354777455329895,
-0.69888836145401,
0.20283758640289307,
0.040187299251556396,
0.2839813828468323,
... |
api/window/requestresize/index.md | API - Window - requestResize - Examples - Using `requestResize()` - The embedded `frame.html`:
The `frame.html` document includes a `div` element with a `tabindex` value of `0` set so that it is focusable. It contains a heading and some paragraphs. The document also includes the `<meta name="responsive-embedded-sizing... | [
0.29244452714920044,
-0.44395536184310913,
0.21338777244091034,
0.31968966126441956,
-0.07202965021133423,
-1.3017935752868652,
0.48249346017837524,
0.7157199382781982,
0.2755592167377472,
0.38224977254867554,
-0.618767499923706,
0.5762379765510559,
-0.3665686249732971,
0.3338163495063782,... |
api/window/vrdisplayconnect_event/index.md | API - Window - vrdisplayconnect event:
Deprecated: This feature is no longer recommended. Non-standard: This feature is not standardized.
The `vrdisplayconnect` event of the WebVR API is fired when a compatible VR display is connected to the computer.
Note: This event was part of the old WebVR API. It has been super... | [
0.06879104673862457,
-0.33573010563850403,
-0.19512410461902618,
0.8617224097251892,
-0.6892166137695312,
-0.6717182397842407,
0.6687266826629639,
0.43890130519866943,
0.6233047842979431,
0.44341030716896057,
-0.4449710249900818,
0.2146938145160675,
0.6264384984970093,
0.9502004384994507,
... |
api/window/vrdisplayconnect_event/index.md | API - Window - vrdisplayconnect event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("vrdisplayconnect", (event) => { })
onvrdisplayconnect = (event) => { } | [
0.14529789984226227,
-0.488101601600647,
-0.3641383945941925,
0.7052769660949707,
-0.7295494675636292,
-0.6694924831390381,
0.37199416756629944,
0.5529945492744446,
0.6810638308525085,
0.3569389283657074,
-0.6930631399154663,
0.7417792677879333,
-0.15814469754695892,
0.5784886479377747,
... |
api/window/vrdisplayconnect_event/index.md | API - Window - vrdisplayconnect event - Event type:
A `VRDisplayEvent`. Inherits from `Event`. | [
-0.46888619661331177,
-0.6337523460388184,
-0.11202464997768402,
0.4820913076400757,
-0.9600181579589844,
-0.12800109386444092,
0.35561779141426086,
0.4205479323863983,
0.28213244676589966,
0.2905450761318207,
-0.22309371829032898,
0.42418497800827026,
-0.14295554161071777,
0.5904754996299... |
api/window/vrdisplayconnect_event/index.md | API - Window - vrdisplayconnect event - Examples:
You can use the `vrdisplayconnect` event in an `addEventListener` method:
Example:
window.addEventListener("vrdisplayconnect", () => {
info.textContent = "Display connected.";
reportDisplays();
});
Or use the `onvrdisplayconnect` event handler property:
Example... | [
-0.03811017796397209,
-0.44982364773750305,
-0.5193411707878113,
1.0764158964157104,
-1.0084812641143799,
-0.7780342698097229,
0.4346781075000763,
0.9879668951034546,
0.4679759740829468,
0.3504262864589691,
-0.7273622751235962,
0.7427891492843628,
0.05438543111085892,
0.7939985990524292,
... |
api/window/deviceorientation_event/index.md | API - Window - deviceorientation event:
Secure context: This feature is available only in secure contexts (HTTPS).
The `deviceorientation` event is fired when fresh data is available from an orientation sensor about the current orientation of the device as compared to the Earth coordinate frame. This data is gathered... | [
0.17802748084068298,
-0.19235220551490784,
-0.9629404544830322,
0.03046039491891861,
0.0086418017745018,
-0.7640587091445923,
0.4052667021751404,
1.1698384284973145,
-0.14545892179012299,
0.3723394274711609,
-0.007268870249390602,
0.8947786688804626,
0.5478363037109375,
0.35575705766677856... |
api/window/deviceorientation_event/index.md | API - Window - deviceorientation event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("deviceorientation", (event) => { })
ondeviceorientation = (event) => { } | [
0.12360917031764984,
-0.4385228455066681,
-0.5603614449501038,
0.07548252493143082,
-0.6556574702262878,
-0.4925074577331543,
-0.03282365947961807,
0.3908901512622833,
0.794189989566803,
0.20929735898971558,
-0.5098482370376587,
0.24697929620742798,
0.29596439003944397,
0.3482303321361542,... |
api/window/deviceorientation_event/index.md | API - Window - deviceorientation event - Event type:
A `DeviceOrientationEvent`. Inherits from `Event`. | [
-0.25121021270751953,
-0.25378748774528503,
-0.31529995799064636,
-0.2829882800579071,
-0.9922810792922974,
-0.6547081470489502,
0.07132492959499359,
0.23377275466918945,
0.23852196335792542,
0.5340286493301392,
-0.1503514051437378,
-0.05540555715560913,
0.30174925923347473,
0.493110239505... |
api/window/deviceorientation_event/index.md | API - Window - deviceorientation event - Examples:
Example:
if (window.DeviceOrientationEvent) {
window.addEventListener(
"deviceorientation",
(event) => {
const rotateDegrees = event.alpha; // alpha: rotation around z-axis
const leftToRight = event.gamma; // gamma: left to right
const fro... | [
-0.44960248470306396,
-0.11152228713035583,
-0.5295603275299072,
0.5273317694664001,
-0.834307849407196,
-0.904841959476471,
-0.33636972308158875,
0.156425341963768,
0.4511913061141968,
0.1563595086336136,
-0.5716033577919006,
0.48840439319610596,
0.21291153132915497,
0.6059987545013428,
... |
api/window/hashchange_event/index.md | API - Window - hashchange event:
The `hashchange` event is fired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the `#` symbol).
This event does not fire when the hash is modified using `history.pushState()` or `history.replaceState()`. | [
-0.03191368654370308,
-0.6613451838493347,
-0.542012095451355,
-0.2508261799812317,
-0.23625876009464264,
-1.1162973642349243,
0.689386248588562,
1.8370225429534912,
-0.36600226163864136,
0.04310842230916023,
-0.580051064491272,
0.31139102578163147,
0.187814399600029,
0.607670783996582,
... |
api/window/hashchange_event/index.md | API - Window - hashchange event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("hashchange", (event) => { })
onhashchange = (event) => { } | [
0.2906143367290497,
-0.30329373478889465,
-0.28482693433761597,
0.19959242641925812,
-0.3225732743740082,
-1.4441230297088623,
0.3243504762649536,
0.7341946363449097,
0.7339962124824524,
0.16330043971538544,
-0.8104416131973267,
0.23280972242355347,
-0.07692782580852509,
0.0846228748559951... |
api/window/hashchange_event/index.md | API - Window - hashchange event - Event type:
A `HashChangeEvent`. Inherits from `Event`. | [
-0.32674336433410645,
0.04365978389978409,
-0.07555858790874481,
0.011418867856264114,
-0.707372784614563,
-1.3697474002838135,
0.4047175943851471,
0.7739616632461548,
0.4724336862564087,
0.1656608283519745,
-0.02496904507279396,
0.11917893588542938,
-0.035142187029123306,
0.21505793929100... |
api/window/hashchange_event/index.md | API - Window - hashchange event - Event handler aliases:
In addition to the `Window` interface, the event handler property `onhashchange` is also available on the following targets:
- `HTMLBodyElement`
- `HTMLFrameSetElement`
- `SVGSVGElement` | [
-0.48221272230148315,
0.6521613001823425,
0.08484278619289398,
-0.0012328997254371643,
-0.33590787649154663,
-2.0431296825408936,
-0.030249014496803284,
0.6508926749229431,
0.6339569687843323,
-0.09765015542507172,
0.10968871414661407,
0.9922568798065186,
0.5925471186637878,
0.166126891970... |
api/window/hashchange_event/index.md | API - Window - hashchange event - Examples:
You can use the `hashchange` event in an `addEventListener` method:
Example:
window.addEventListener("hashchange", () => {
console.log("The hash has changed!");
});
Or use the `onhashchange` event handler property:
Example:
function locationHashChanged() {
if (locat... | [
0.6216009855270386,
-0.5734658241271973,
-0.7334628105163574,
0.6837720274925232,
0.022295214235782623,
-1.90802800655365,
0.6957679390907288,
1.3497768640518188,
0.15384162962436676,
0.12752515077590942,
0.312999963760376,
0.8641554117202759,
0.46637585759162903,
0.401243656873703,
-0.3... |
api/window/pageshow_event/index.md | API - Window - pageshow event:
The `pageshow` event is sent to a `Window` when the browser navigates to a new document.
This includes:
- Initially loading the page.
- Navigating to the page from another page in the same window or tab.
- Restoring a frozen page on mobile OSes.
- Returning to the page using the browse... | [
0.5300874710083008,
0.028905946761369705,
-0.4976595342159271,
0.3905113637447357,
-0.16749052703380585,
-0.9976063966751099,
0.612393856048584,
0.15339654684066772,
0.23051851987838745,
0.9891294836997986,
0.059981316328048706,
0.5160139203071594,
0.18592427670955658,
0.658534586429596,
... |
api/window/pageshow_event/index.md | API - Window - pageshow event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pageshow", (event) => { })
onpageshow = (event) => { } | [
0.3874121606349945,
-0.05555344745516777,
-0.5728470087051392,
0.6108720898628235,
-0.04896742105484009,
-0.8234881162643433,
0.311968594789505,
0.4626177251338959,
0.40704452991485596,
0.5697269439697266,
-0.42905014753341675,
0.6668157577514648,
-0.12376493960618973,
0.21609199047088623,... |
api/window/pageshow_event/index.md | API - Window - pageshow event - Event type:
A `PageTransitionEvent`. Inherits from `Event`. | [
-0.2872943878173828,
-0.10622186958789825,
-0.2132895588874817,
0.09445969760417938,
-0.5017111301422119,
-0.6457448601722717,
0.4048924148082733,
0.4966288208961487,
0.594254732131958,
0.49007895588874817,
-0.0920693427324295,
0.27789822220802307,
0.19367267191410065,
0.6279454231262207,
... |
api/window/pageshow_event/index.md | API - Window - pageshow event - Event handler aliases:
In addition to the `Window` interface, the event handler property `onpageshow` is also available on the following targets:
- `HTMLBodyElement`
- `HTMLFrameSetElement`
- `SVGSVGElement` | [
-0.430900514125824,
0.8840795159339905,
0.012924686074256897,
-0.030093425884842873,
-0.29591137170791626,
-1.1884300708770752,
-0.1701774299144745,
0.3332139551639557,
0.2870502173900604,
0.3057471513748169,
0.036332033574581146,
1.0448675155639648,
0.3428606688976288,
0.3234817683696747,... |
api/window/pageshow_event/index.md | API - Window - pageshow event - Examples:
This example sets up event handlers for events listed in the array `events`. The handler, `eventLogger()`, logs the type of event that occurred to the console, and includes the value of the `persisted` flag on `pageshow` and `pagehide` events. | [
0.04740915820002556,
-0.78969407081604,
-0.9811508655548096,
0.7855433821678162,
-0.2351943552494049,
-1.3410651683807373,
0.13636617362499237,
0.6006549000740051,
0.6641067862510681,
0.28144538402557373,
-0.031144898384809494,
0.7562148571014404,
0.4827556014060974,
0.43882447481155396,
... |
api/window/pageshow_event/index.md | API - Window - pageshow event - Examples - JavaScript:
Example:
const events = ["pagehide", "pageshow", "unload", "load"];
const eventLogger = (event) => {
switch (event.type) {
case "pagehide":
case "pageshow": {
let isPersisted = event.persisted ? "persisted" : "not persisted";
console.log(`E... | [
-0.1394500881433487,
-0.8737443685531616,
-0.7360278367996216,
0.48626917600631714,
-0.385373055934906,
-0.7594807744026184,
-0.18192411959171295,
0.663911759853363,
0.10757209360599518,
0.38372403383255005,
-0.07356083393096924,
0.45904451608657837,
-0.1658019870519638,
0.5271781086921692... |
api/window/pageshow_event/index.md | API - Window - pageshow event - Examples - HTML:
Example:
<p>
Open the console and watch the output as you navigate to and from this page.
Try loading new pages into this tab, then navigating forward and backward
through history, noting the events' output to the log.
</p> | [
0.10711350291967392,
-0.17505867779254913,
-0.8245863318443298,
0.15802252292633057,
-0.4114384055137634,
-0.8791306614875793,
0.22104212641716003,
0.1827262043952942,
-0.1434807926416397,
0.7055386900901794,
-0.43414008617401123,
0.619779109954834,
0.5006815791130066,
0.5186052918434143,
... |
api/window/pagereveal_event/index.md | API - Window - pagereveal event:
The `pagereveal` event is fired when a document is first rendered, either when loading a fresh document from the network or activating a document (either from back/forward cache (bfcache) or prerender).
This is useful in the case of cross-document (MPA) view transitions for manipulati... | [
-0.1781473457813263,
-0.2948765158653259,
-0.24057018756866455,
0.31341904401779175,
-0.01153431087732315,
-0.8844254016876221,
0.6069608330726624,
0.7592639327049255,
0.5967400074005127,
0.6836653351783752,
-0.3394661843776703,
0.11381709575653076,
0.10703693330287933,
0.34669265151023865... |
api/window/pagereveal_event/index.md | API - Window - pagereveal event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pagereveal", (event) => { })
onpagereveal = (event) => { } | [
0.27299225330352783,
-0.17374064028263092,
-0.4010023772716522,
0.5706341862678528,
-0.19367989897727966,
-1.2563443183898926,
0.46882104873657227,
0.8613976836204529,
0.5365411043167114,
0.8149449229240417,
-0.2669800817966461,
0.5315369367599487,
-0.46556997299194336,
0.07842211425304413... |
api/window/pagereveal_event/index.md | API - Window - pagereveal event - Event type:
A `PageRevealEvent`. Inherits from `Event`. | [
-0.08515579998493195,
0.4226834774017334,
0.06877477467060089,
-0.02565765380859375,
-0.6996006965637207,
-0.6886147856712341,
0.7302424907684326,
0.851924479007721,
0.13802337646484375,
0.569442629814148,
0.14843279123306274,
0.706714928150177,
-0.3100215792655945,
0.3327461779117584,
0... |
api/window/pagereveal_event/index.md | API - Window - pagereveal event - Examples:
Example:
window.addEventListener("pagereveal", async (e) => {
// If the "from" history entry does not exist, return
if (!navigation.activation.from) return;
// Only run this if an active view transition exists
if (e.viewTransition) {
const fromUrl = new URL(nav... | [
-0.505856990814209,
-0.4032682776451111,
0.09238019585609436,
0.28733307123184204,
0.04198242723941803,
-0.2644270658493042,
0.9568464159965515,
1.142212986946106,
-0.5920838713645935,
0.693717896938324,
0.24771416187286377,
0.45115429162979126,
0.2007039338350296,
0.20323020219802856,
-... |
api/window/vrdisplaydisconnect_event/index.md | API - Window - vrdisplaydisconnect event:
Deprecated: This feature is no longer recommended. Non-standard: This feature is not standardized.
The `vrdisplaydisconnect` event of the WebVR API is fired when a compatible VR display is disconnected from the computer.
This event is not cancelable and does not bubble. | [
0.11114878207445145,
-0.5151914954185486,
-0.06464563310146332,
0.7108720541000366,
-0.6275784373283386,
-0.9436658620834351,
0.39266088604927063,
0.28893136978149414,
0.9250634908676147,
0.18020422756671906,
-0.6062943935394287,
0.13964056968688965,
0.6394451856613159,
0.5513670444488525,... |
api/window/vrdisplaydisconnect_event/index.md | API - Window - vrdisplaydisconnect event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("vrdisplaydisconnect", (event) => { })
onvrdisplaydisconnect = (event) => { } | [
0.4084174931049347,
-0.49239054322242737,
-0.5439637899398804,
0.7608404755592346,
-0.7814026474952698,
-0.8394931554794312,
0.5503926873207092,
0.5802043080329895,
0.6133409738540649,
0.6298007369041443,
-0.8499897122383118,
0.6253476738929749,
-0.09135796874761581,
0.6987519264221191,
... |
api/window/vrdisplaydisconnect_event/index.md | API - Window - vrdisplaydisconnect event - Event type:
A `VRDisplayEvent`. Inherits from `Event`. | [
-0.4012538492679596,
-0.5413222312927246,
0.018590159714221954,
0.5055902004241943,
-1.0857665538787842,
-0.45698484778404236,
0.47562146186828613,
0.40424367785453796,
0.19701597094535828,
0.5106587409973145,
-0.18859535455703735,
0.07516133785247803,
-0.13866743445396423,
0.6397144794464... |
api/window/vrdisplaydisconnect_event/index.md | API - Window - vrdisplaydisconnect event - Examples:
You can use the `vrdisplaydisconnect` event in an `addEventListener` method:
Note: This event was part of the old WebVR API. It has been superseded by the WebXR Device API.
Example:
window.addEventListener("vrdisplaydisconnect", () => {
info.textContent = "Disp... | [
0.15294909477233887,
-0.3197239935398102,
-0.4643417298793793,
1.0888031721115112,
-0.5994959473609924,
-0.9807291626930237,
0.38670989871025085,
0.8986369967460632,
0.5091269016265869,
0.5377716422080994,
-0.30205756425857544,
0.528544545173645,
0.2678392231464386,
0.8484627604484558,
0... |
api/window/focus_event/index.md | API - Window - focus event:
The `focus` event fires when an element has received focus.
The opposite of `focus` is `blur`.
This event is not cancelable and does not bubble. | [
-0.8195383548736572,
-0.0035112546756863594,
0.14652568101882935,
-0.03255844861268997,
-0.3894559442996979,
-1.5492684841156006,
0.3358808755874634,
0.6310391426086426,
-0.10509436577558517,
0.26799488067626953,
-0.4897805452346802,
0.35061803460121155,
-0.21977761387825012,
0.93100589513... |
api/window/focus_event/index.md | API - Window - focus event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("focus", (event) => { })
onfocus = (event) => { } | [
0.6000135540962219,
-0.19295942783355713,
-0.21315091848373413,
0.12305532395839691,
-0.22146734595298767,
-1.3660502433776855,
0.1282169222831726,
0.6927283406257629,
0.6836791634559631,
0.10630640387535095,
-0.7667819261550903,
0.7161148190498352,
-0.30781030654907227,
0.4596410989761352... |
api/window/focus_event/index.md | API - Window - focus event - Event type:
A `FocusEvent`. Inherits from `UIEvent` and `Event`. | [
-0.11137881875038147,
-0.30015695095062256,
-0.7315739393234253,
-0.18892569839954376,
-0.5336552858352661,
-0.6071954369544983,
-0.3134025037288666,
0.5698361992835999,
-0.10383753478527069,
0.38405200839042664,
0.13078978657722473,
1.0615848302841187,
-0.030533213168382645,
0.64687711000... |
api/window/focus_event/index.md | API - Window - focus event - Examples - Live example:
This example changes the appearance of a document when it loses focus. It uses `addEventListener()` to monitor `focus` and `blur` events. | [
-0.5386658906936646,
-0.1999412328004837,
-0.07000180333852768,
0.37179213762283325,
-0.7204664945602417,
-1.3056665658950806,
0.25824058055877686,
0.483268678188324,
0.3927421271800995,
0.5743090510368347,
-0.19306302070617676,
0.6894315481185913,
-0.15661144256591797,
0.828957200050354,
... |
api/window/focus_event/index.md | API - Window - focus event - Examples - Live example - HTML:
Example:
<p id="log">Click on this document to give it focus.</p> | [
-0.38683658838272095,
0.021833043545484543,
0.0974736213684082,
-0.0516386404633522,
-0.49827367067337036,
-1.3330408334732056,
0.6367018818855286,
0.05685184895992279,
-0.49624311923980713,
0.5426580905914307,
-0.19965587556362152,
0.8336554765701294,
0.23744946718215942,
0.55027598142623... |
api/window/focus_event/index.md | API - Window - focus event - Examples - Live example - CSS:
Example:
.paused {
background: #dddddd;
color: #555555;
} | [
-0.5046987533569336,
0.17154161632061005,
-0.02120257169008255,
-0.8012192845344543,
-0.29443448781967163,
-0.4542648196220398,
0.304044246673584,
0.472187876701355,
-1.110824704170227,
0.8660992383956909,
0.20013855397701263,
0.21783003211021423,
-0.05777789652347565,
0.5269584655761719,
... |
api/window/focus_event/index.md | API - Window - focus event - Examples - Live example - JavaScript:
Example:
const log = document.getElementById("log");
function pause() {
document.body.classList.add("paused");
log.textContent = "FOCUS LOST!";
}
function play() {
document.body.classList.remove("paused");
log.textContent =
"This documen... | [
0.01024286262691021,
-0.37631186842918396,
-0.7504586577415466,
-0.06041273474693298,
-0.4409293830394745,
-0.8486237525939941,
0.28152766823768616,
0.5902178883552551,
-0.15505564212799072,
0.21580824255943298,
-0.24784088134765625,
0.159746453166008,
0.030464831739664078,
0.4133827388286... |
api/window/vrdisplaydeactivate_event/index.md | API - Window - vrdisplaydeactivate event:
Deprecated: This feature is no longer recommended. Non-standard: This feature is not standardized.
The `vrdisplaydeactivate` event of the WebVR API is fired when a VR display can no longer be presented to, for example if an HMD has gone into standby or sleep mode due to a per... | [
0.7169049978256226,
0.0030002519488334656,
-0.0015723314136266708,
0.48153769969940186,
-0.890925943851471,
-0.3416738212108612,
0.3432405889034271,
0.8052359819412231,
0.3382889926433563,
-0.04912964254617691,
-0.17751213908195496,
0.49658381938934326,
0.8221943974494934,
0.59785282611846... |
api/window/vrdisplaydeactivate_event/index.md | API - Window - vrdisplaydeactivate event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("vrdisplaydeactivate", (event) => { })
onvrdisplaydeactivate = (event) => { } | [
0.5305883884429932,
-0.414588987827301,
-0.22026419639587402,
1.176475167274475,
-0.49021196365356445,
-1.167110800743103,
0.4308510422706604,
0.8114752173423767,
0.4567677974700928,
0.45867371559143066,
-0.9182184934616089,
0.3620634377002716,
-0.1683618575334549,
0.45653998851776123,
0... |
api/window/vrdisplaydeactivate_event/index.md | API - Window - vrdisplaydeactivate event - Event type:
A `VRDisplayEvent`. Inherits from `Event`. | [
0.07038901746273041,
-0.3768518567085266,
0.23641356825828552,
0.3976835012435913,
-0.9084886312484741,
-0.5151074528694153,
0.61887526512146,
0.5124129056930542,
0.7662638425827026,
0.23740842938423157,
-0.46412619948387146,
0.47532689571380615,
-0.05833476781845093,
0.5658110976219177,
... |
api/window/vrdisplaydeactivate_event/index.md | API - Window - vrdisplaydeactivate event - Examples:
You can use the `vrdisplaydeactivate` event in an `addEventListener` method:
Example:
window.addEventListener("vrdisplaydeactivate", () => {
info.textContent = "Display deactivated.";
reportDisplays();
});
Or use the `onvrdisplaydeactivate` event handler prop... | [
0.15955674648284912,
-0.3591419756412506,
-0.42300668358802795,
1.3241380453109741,
-0.71368807554245,
-1.644026279449463,
0.5790075063705444,
1.06640625,
0.344955176115036,
0.3614834249019623,
-0.49619242548942566,
0.4716479182243347,
-0.271164208650589,
0.5800273418426514,
0.8042953014... |
api/window/scrollto/index.md | API - Window - scrollTo:
The `scrollTo()` method of the `Window` interface scrolls to a particular set of coordinates in the document. | [
-0.5650529265403748,
0.20054683089256287,
-0.3112352788448334,
0.41532284021377563,
-0.14361460506916046,
-1.2540183067321777,
0.08809711784124374,
-0.32183903455734253,
0.4774250388145447,
-0.18096718192100525,
-0.7140852808952332,
0.3464130461215973,
0.599639892578125,
0.5880566835403442... |
api/window/scrollto/index.md | API - Window - scrollTo - Syntax:
Example:
scrollTo(xCoord, yCoord)
scrollTo(options) | [
-0.6100172996520996,
-0.18759582936763763,
-0.006064223125576973,
0.17460918426513672,
-0.4646705090999603,
-1.251059889793396,
0.5371211767196655,
-0.028634430840611458,
0.44990265369415283,
-0.33240485191345215,
-0.11147230118513107,
0.008052192628383636,
-0.20813590288162231,
0.80509179... |
api/window/scrollto/index.md | API - Window - scrollTo - Syntax - Parameters:
- `xCoord`: The x-coordinate of the document that you want the viewport's left edge to scroll to.
- `yCoord`: The y-coordinate of the document that you want the viewport's top edge to scroll to.
- `options`: An object containing the following properties:
- `top` (option... | [
-0.6290263533592224,
-0.5067577362060547,
-0.5736780166625977,
0.46640074253082275,
-0.1067495122551918,
-1.2040729522705078,
0.8303055763244629,
-0.08547419309616089,
0.5604331493377686,
0.21441969275474548,
-0.5728439688682556,
-0.23289033770561218,
0.21733257174491882,
0.588540673255920... |
api/window/scrollto/index.md | API - Window - scrollTo - Syntax - Return value:
A `Promise` that fulfills with an object containing the following property:
- `interrupted`: A boolean value indicating whether the scrolling operation was interrupted (`true`) or not (`false`). Such an interruption typically happens when a programmatic scroll is ongoi... | [
-0.8195958733558655,
0.24670332670211792,
-0.19671446084976196,
0.42239636182785034,
-0.04396691918373108,
-1.2962732315063477,
0.49070388078689575,
0.5799332857131958,
-0.05802280455827713,
0.05554785206913948,
-0.2754656672477722,
0.27556881308555603,
0.17759589850902557,
0.4848738908767... |
api/window/scrollto/index.md | API - Window - scrollTo - Examples - Basic usage:
Example:
window.scrollTo(0, 1000);
Using `options`:
Example:
window.scrollTo({
top: 100,
left: 100,
behavior: "smooth",
}); | [
-0.8927071690559387,
0.11824965476989746,
-0.24666519463062286,
0.3082472085952759,
-0.5309299230575562,
-1.3837041854858398,
0.7008499503135681,
0.17341971397399902,
-0.09516450762748718,
-0.3373502194881439,
-0.3256605863571167,
-0.2810404300689697,
0.3448300063610077,
0.1313194781541824... |
api/window/scrollto/index.md | API - Window - scrollTo - Examples - Responding to the end of the scroll:
Our window methods demo (see source code) demonstrates how the promise return value of `scrollTo()` can be used to respond to the end of a scrolling operation. This technique is mostly useful in cases where the scrolling occurs smoothly over tim... | [
-0.7208386063575745,
0.03578855097293854,
-0.44886448979377747,
0.5736156702041626,
-0.08629533648490906,
-1.3696537017822266,
0.6411898136138916,
0.8027073740959167,
0.21762564778327942,
0.5859668254852295,
0.2802762985229492,
0.7473278641700745,
0.887299656867981,
0.7596661448478699,
-... |
api/window/scrollto/index.md | API - Window - scrollTo - Examples - Responding to the end of the scroll - HTML:
Our HTML includes several paragraphs of content and a `div` element toolbar containing `button` elements that trigger various scrolling operations on the window.
Example:
<div>
<button class="scroll">scroll() to 1000</button>
<butto... | [
-1.3642398118972778,
-0.3341723084449768,
-0.039490971714258194,
0.9306120276451111,
-0.1870242953300476,
-0.8924129009246826,
0.20609712600708008,
0.2748090624809265,
-0.3120765686035156,
0.6821399927139282,
-0.2163117378950119,
0.07910469174385071,
0.09732472896575928,
0.4478372931480407... |
api/window/scrollto/index.md | API - Window - scrollTo - Examples - Responding to the end of the scroll - CSS:
We give the `:root` element a `scroll-behavior` property value of `smooth` so that any scroll operations are animated smoothly over time rather than instantly.
Example:
:root {
scroll-behavior: smooth;
}
We also create two class selec... | [
-0.4715381860733032,
-0.6043575406074524,
-0.2466096431016922,
0.43168729543685913,
0.4080052375793457,
-1.5211615562438965,
0.6219249963760376,
0.8412821292877197,
-0.23400026559829712,
0.8589133024215698,
0.07337334752082825,
-0.8304914236068726,
0.3359178602695465,
0.08379395306110382,
... |
api/window/scrollto/index.md | API - Window - scrollTo - Examples - Responding to the end of the scroll - JavaScript:
We start by grabbing references to the `<button>` that runs the `scrollTo()` operation and the toolbar `<div>`:
Example:
const scrollToBtn = document.querySelector(".scroll-to");
const toolbar = document.querySelector("div");
Nex... | [
-0.3636987507343292,
-0.15382786095142365,
-0.3045516014099121,
0.324746310710907,
0.3269515037536621,
-0.7608745098114014,
0.29054272174835205,
0.8622174263000488,
0.29989078640937805,
0.660788357257843,
-0.5081754922866821,
0.14382703602313995,
-0.3587055504322052,
0.19794625043869019,
... |
api/window/scrollto/index.md | API - Window - scrollTo - Examples - Responding to the end of the scroll - Aside on feature detection:
If you run this example in a browser that doesn't support promise-returning scroll operations, the scroll operations are still smooth, but the toolbar doesn't fade out and then fade back in once the operation is fini... | [
-0.1632077544927597,
0.06827271729707718,
-0.8246169090270996,
0.7070170640945435,
0.5450022220611572,
-1.2655315399169922,
0.03367026895284653,
1.0647505521774292,
0.2905726134777069,
0.5454232692718506,
-0.12062341719865799,
0.01928865909576416,
0.36543554067611694,
0.6528136134147644,
... |
api/window/pagehide_event/index.md | API - Window - pagehide event:
The `pagehide` event is sent to a `Window` when the browser hides the current page in the process of presenting a different page from the session's history.
For example, when the user clicks the browser's Back button, the current page receives a `pagehide` event before the previous page... | [
-0.13659028708934784,
0.020763196051120758,
-0.9288874864578247,
0.6850278973579407,
-0.32464247941970825,
-0.9565933346748352,
0.6045183539390564,
0.3866947591304779,
-0.16524183750152588,
0.7155933380126953,
-0.32184600830078125,
0.9014800190925598,
-0.09819181263446808,
1.18058145046234... |
api/window/pagehide_event/index.md | API - Window - pagehide event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pagehide", (event) => { })
onpagehide = (event) => { } | [
0.29454442858695984,
-0.024609804153442383,
-0.1373637169599533,
0.2893761396408081,
-0.22707301378250122,
-1.1271450519561768,
0.2567339837551117,
0.3801308274269104,
0.7255565524101257,
0.22503797709941864,
-0.471856027841568,
0.578839123249054,
-0.3193400502204895,
0.43066105246543884,
... |
api/window/pagehide_event/index.md | API - Window - pagehide event - Event type:
A `PageTransitionEvent`. Inherits from `Event`. | [
-0.08309043943881989,
0.04759184643626213,
-0.10517298430204391,
0.3353269100189209,
-0.6781058311462402,
-0.8114460110664368,
0.704849898815155,
0.824314534664154,
0.09593911468982697,
0.40608540177345276,
-0.02724277600646019,
0.6563328504562378,
-0.08529746532440186,
0.6117326617240906,... |
api/window/pagehide_event/index.md | API - Window - pagehide event - Event handler aliases:
In addition to the `Window` interface, the event handler property `onpagehide` is also available on the following targets:
- `HTMLBodyElement`
- `HTMLFrameSetElement`
- `SVGSVGElement` | [
-0.43497154116630554,
0.8021705150604248,
0.2668284773826599,
0.12799033522605896,
-0.2258576899766922,
-1.7575342655181885,
0.10211323201656342,
0.5804916620254517,
0.48644179105758667,
0.17424176633358002,
0.1109011322259903,
0.9253828525543213,
0.2567673921585083,
0.2733864188194275,
... |
api/window/pagehide_event/index.md | API - Window - pagehide event - Usage notes:
Like the `unload` and `beforeunload` events, this event is not reliably fired by browsers, especially on mobile. For example, the `pagehide` event is not fired at all in the following scenario:
- A mobile user visits your page.
- The user then switches to a different app.
... | [
0.7308268547058105,
-0.2859048843383789,
-1.0079314708709717,
-0.38435661792755127,
0.4340987205505371,
-0.7233186960220337,
0.42094820737838745,
1.1749993562698364,
-0.2970784604549408,
0.6747606992721558,
0.2746557891368866,
1.0562211275100708,
0.23874551057815552,
0.48793476819992065,
... |
api/window/pagehide_event/index.md | API - Window - pagehide event - Examples:
In this example, an event handler is established to watch for `pagehide` events and to perform special handling if the page is being persisted for possible reuse.
Example:
window.addEventListener("pagehide", (event) => {
if (event.persisted) {
/* the page isn't being d... | [
0.13554231822490692,
0.05904315412044525,
-0.07739047706127167,
0.8594914078712463,
-0.15335126221179962,
-0.9490214586257935,
0.44286882877349854,
1.021985650062561,
0.41597211360931396,
0.19368211925029755,
-0.4870685935020447,
1.0661119222640991,
-0.17975105345249176,
0.6159238815307617... |
api/window/localstorage/index.md | API - Window - localStorage:
The `localStorage` read-only property of the `window` interface allows you to access a `Storage` object for the `Document`'s `origin`; the stored data is saved across browser sessions.
`localStorage` is similar to `sessionStorage`, except that while `localStorage` data has no expiration t... | [
0.4059320390224457,
-0.4505709111690521,
-0.7020694613456726,
0.1855393946170807,
0.08058531582355499,
-1.4422078132629395,
0.9057831168174744,
1.4667896032333374,
0.45551663637161255,
-0.4433257579803467,
-0.11152303963899612,
0.9661159515380859,
-0.15169349312782288,
0.7152803540229797,
... |
api/window/localstorage/index.md | API - Window - localStorage - Value:
A `Storage` object which can be used to access the current origin's local storage space. | [
-0.28807488083839417,
0.5112674236297607,
0.10554397106170654,
0.11699630320072174,
0.25080567598342896,
-1.5150200128555298,
1.311532735824585,
0.43774986267089844,
0.05262216925621033,
-0.36159276962280273,
-0.5054718255996704,
0.7500468492507935,
-0.4660516679286957,
0.4088652729988098,... |
api/window/localstorage/index.md | API - Window - localStorage - Value - Exceptions:
- `SecurityError`: Thrown in one of the following cases: - The origin is not a valid scheme/host/port tuple. This can happen if the origin uses the `file:` or `data:` schemes, for example. - The request violates a policy decision. For example, the user has configure... | [
-0.16121593117713928,
-0.522098183631897,
-0.356258362531662,
-0.022714244201779366,
-0.4746895432472229,
-1.5939420461654663,
0.5432233214378357,
0.5619165301322937,
0.47509586811065674,
-0.047019436955451965,
0.08910928666591644,
0.37400028109550476,
-0.2875197231769562,
-0.2633857131004... |
api/window/localstorage/index.md | API - Window - localStorage - Description:
The keys and the values stored with `localStorage` are in the `UTF-16` string format. As with objects, integer keys are automatically converted to strings.
`localStorage` data is specific to the protocol of the document. In particular, for a site loaded over HTTP (e.g., `htt... | [
-0.14564381539821625,
-0.5799355506896973,
-0.22673232853412628,
0.298054039478302,
0.7192612290382385,
-0.6833261251449585,
1.1184097528457642,
1.550746202468872,
-0.39765676856040955,
-0.6149194836616516,
0.15187253057956696,
1.0390160083770752,
-0.6145625114440918,
0.5688608884811401,
... |
api/window/localstorage/index.md | API - Window - localStorage - Examples:
The following snippet accesses the current domain's local `Storage` object and adds a data item to it using `Storage.setItem()`, or updates the item if one already exists for that key.
Example:
localStorage.setItem("myCat", "Tom");
The syntax for reading the `localStorage` it... | [
-0.47356438636779785,
-0.24585013091564178,
0.46201813220977783,
0.6474397778511047,
0.45185738801956177,
-1.4446580410003662,
-0.08164013922214508,
0.8097671270370483,
0.8156077265739441,
-0.2515324354171753,
-0.7016006112098694,
1.1458936929702759,
-0.77667236328125,
0.5870513319969177,
... |
api/window/devicemotion_event/index.md | API - Window - devicemotion event:
Secure context: This feature is available only in secure contexts (HTTPS).
The `devicemotion` event is fired at a regular interval and indicates the acceleration rate of the device with/without the contribution of the gravity force at that time. It also provides information about th... | [
-0.6655409932136536,
-0.25011351704597473,
-0.3734636604785919,
0.7421494722366333,
-0.42489755153656006,
-0.8969404697418213,
0.5185695290565491,
0.45579993724823,
-0.23030740022659302,
0.5053997039794922,
-0.16960285604000092,
0.6586074233055115,
0.09707091748714447,
0.20932799577713013,... |
api/window/devicemotion_event/index.md | API - Window - devicemotion event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("devicemotion", (event) => { })
ondevicemotion = (event) => { } | [
0.1572871059179306,
-0.538531482219696,
-0.7160264849662781,
0.21938371658325195,
-0.5106003880500793,
-1.0554882287979126,
-0.04226822406053543,
0.8229449987411499,
0.45532548427581787,
0.34767377376556396,
-0.43633806705474854,
0.5188975930213928,
0.02534317970275879,
0.39947763085365295... |
api/window/devicemotion_event/index.md | API - Window - devicemotion event - Event type:
A `DeviceMotionEvent`. Inherits from `Event`. | [
-0.17412783205509186,
-0.24401098489761353,
-0.4235038757324219,
-0.24496109783649445,
-0.7460343241691589,
-0.7306617498397827,
-0.05917081609368324,
0.41902974247932434,
0.18931186199188232,
0.362247496843338,
0.014474287629127502,
0.1394554078578949,
0.08781924843788147,
0.4983881115913... |
api/window/devicemotion_event/index.md | API - Window - devicemotion event - Examples:
Example:
function handleMotionEvent(event) {
const x = event.accelerationIncludingGravity.x;
const y = event.accelerationIncludingGravity.y;
const z = event.accelerationIncludingGravity.z;
// Do something awesome.
}
window.addEventListener("devicemotion", handle... | [
-0.24511466920375824,
-0.22185173630714417,
-0.09190283715724945,
0.6607885956764221,
-0.6844561696052551,
-1.0350970029830933,
-0.02901352569460869,
0.020846616476774216,
-0.03534901142120361,
0.14335164427757263,
-0.6828122735023499,
0.4588770866394043,
0.01195596158504486,
0.67923760414... |
api/window/vrdisplayactivate_event/index.md | API - Window - vrdisplayactivate event:
Deprecated: This feature is no longer recommended. Non-standard: This feature is not standardized.
The `vrdisplayactivate` event of the WebVR API is fired when a VR display is able to be presented to, for example if an HMD has been moved to bring it out of standby, or woken up ... | [
0.718300998210907,
0.02024616301059723,
0.034752510488033295,
0.8957182765007019,
-0.669061541557312,
-0.5732583403587341,
0.41519489884376526,
0.8151057362556458,
0.15457873046398163,
-0.004545804113149643,
-0.11928564310073853,
0.44674503803253174,
0.6087449789047241,
0.693425714969635,
... |
api/window/vrdisplayactivate_event/index.md | API - Window - vrdisplayactivate event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("vrdisplayactivate", (event) => { })
onvrdisplayactivate = (event) => { } | [
0.5978264212608337,
-0.3194428086280823,
-0.3297838568687439,
1.1143025159835815,
-0.4939570724964142,
-0.9410513639450073,
0.6679694652557373,
0.9194492101669312,
0.244909405708313,
0.4052516222000122,
-0.634432852268219,
0.47580254077911377,
-0.2593834400177002,
0.4149617552757263,
0.0... |
api/window/vrdisplayactivate_event/index.md | API - Window - vrdisplayactivate event - Event type:
A `VRDisplayEvent`. Inherits from `Event`. | [
0.013055938296020031,
-0.6215556263923645,
0.21919196844100952,
0.5298781991004944,
-0.9123016595840454,
-0.2165043205022812,
0.7338615655899048,
0.5169088244438171,
0.3710401654243469,
0.38119542598724365,
-0.1912388652563095,
0.15293937921524048,
-0.10301876813173294,
0.5819125175476074,... |
api/window/vrdisplayactivate_event/index.md | API - Window - vrdisplayactivate event - Examples:
You can use the `vrdisplayactivate` event in an `addEventListener` method:
Example:
window.addEventListener("vrdisplayactivate", () => {
info.textContent = "Display activated.";
reportDisplays();
});
Or use the `onvrdisplayactivate` event handler property:
Exa... | [
0.15668904781341553,
-0.34730809926986694,
-0.22762028872966766,
1.2119841575622559,
-0.7959265112876892,
-1.0911266803741455,
0.5080025792121887,
1.0919352769851685,
0.5403035879135132,
0.24878330528736115,
-0.5724292993545532,
0.48595309257507324,
-0.23882897198200226,
0.4060094654560089... |
api/window/vrdisplaypresentchange_event/index.md | API - Window - vrdisplaypresentchange event:
Deprecated: This feature is no longer recommended. Non-standard: This feature is not standardized.
The `vrdisplaypresentchange` event of the WebVR API is fired when the presenting state of a VR display changes — i.e., goes from presenting to not presenting, or vice versa.
... | [
-0.14611704647541046,
-0.5295659899711609,
-0.12756197154521942,
0.9170369505882263,
-0.6429510712623596,
-1.2235636711120605,
0.05076819658279419,
0.753828227519989,
0.5487957000732422,
0.4743220806121826,
-0.23559103906154633,
0.30231568217277527,
0.7881993055343628,
0.7033007740974426,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.