PageSourceSearch

https://gsap.com/assets/js/535aa14c.21f6c7f9.js

js gsap.com collected 2026-10-02 06:10:42 UTC 4,684 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkgsap_docs=self.webpackChunkgsap_docs||[]).push([[19404],{18345:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>d,default:()=>u,frontMatter:()=>i,metadata:()=>r,toc:()=>l});const r=JSON.parse('{"id":"tween/methods/delay","title":"delay","description":"Returns : \\\\[Number | self\\\\]","source":"@site/docs/tween/methods/delay.mdx","sourceDirName":"tween/methods","slug":"/GSAP/Tween/delay()","permalink":"/docs/v3/GSAP/Tween/delay()","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"delay","slug":"/GSAP/Tween/delay()","hide_title":true,"sidebar_label":".delay()","sidebar_custom_props":{"summary":"<p>Gets or sets the animation\'s initial delay which is the length of time in seconds before the animation should begin.</p>","title":"delay","filter":".delay() - tween","propSummary":"( value:Number ) : [Number | self]","params":[{"name":"value","data":": Number","description":"<p>(default = <code>NaN</code>) - Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.</p>"}]}},"sidebar":"docs","previous":{"title":".vars","permalink":"/docs/v3/GSAP/Tween/vars"},"next":{"title":".duration()","permalink":"/docs/v3/GSAP/Tween/duration()"}}');var s=n(74848),a=n(28453);const i={id:"delay",slug:"/GSAP/Tween/delay()",hide_title:!0,sidebar_label:".delay()",sidebar_custom_props:{summary:"<p>Gets or sets the animation's initial delay which is the length of time in seconds before the animation should begin.</p>",title:"delay",filter:".delay() - tween",propSummary:"( value:Number ) : [Number | self]",params:[{name:"value",data:": Number",description:"<p>(default = <code>NaN</code>) - Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.</p>"}]}},d=void 0,o={},l=[{value:"Returns : [Number | self]",id:"returns--number--self",level:3},{value:"Details",id:"details",level:3}];function c(e){const t={code:"code",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components},{PropDetails:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("PropDetails",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n,{items:i.sidebar_custom_props}),"\n",(0,s.jsx)(t.h3,{id:"returns--number--self",children:"Returns : [Number | self]"}),"\n",(0,s.jsx)(t.p,{children:"Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining."}),"\n",(0,s.jsx)(t.h3,{id:"details",children:"Details"}),"\n",(0,s.jsxs)(t.p,{children:["Gets or sets the animation's initial ",(0,s.jsx)(t.code,{children:"delay"})," which is the length of time in seconds before the animation should begin. A tween's starting values are not recorded until after the ",(0,s.jsx)(t.code,{children:"delay"})," has expired (except in ",(0,s.jsx)(t.code,{children:"from()"})," tweens which render immediately by default unless ",(0,s.jsx)(t.code,{children:"immediateRender: false"})," is set in the ",(0,s.jsx)(t.code,{children:"vars"})," parameter). An animation's ",(0,s.jsx)(t.code,{children:"delay"})," is unaffected by its ",(0,s.jsx)(t.code,{children:"timeScale"}),", so if you were to change ",(0,s.jsx)(t.code,{children:"timeScale"})," from ",(0,s.jsx)(t.code,{children:"1"})," to ",(0,s.jsx)(t.code,{children:"10"}),", for example, it wouldn't cause the delay to grow tenfold."]}),"\n",(0,s.jsxs)(t.p,{children:["This method serves as both a getter and setter. Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining, like ",(0,s.jsx)(t.code,{children:"myAnimation.delay(2).timeScale(0.5).restart(true);"})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"var currentDelay = myAnimation.delay(); //gets current delay\nmyAnimation.delay(2); //sets delay\n"})})]})}function u(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},28453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>d});var r=n(96540);const s={},a=r.createContext(s);function i(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.