Interface ZeptoStatic

Index

Call signatures

Properties

Methods

Call signatures

(selector: string, context?: any): ZeptoCollection

Create a Zepto collection object by performing a CSS selector, wrapping DOM nodes, or creating elements from an HTML string.

Parameters

  • selector: string
  • context?: any optional

Returns

ZeptoCollection

(collection: ZeptoCollection): ZeptoCollection

see

ZeptoStatic();

Parameters

Returns

ZeptoCollection

(element: HTMLElement): ZeptoCollection

see

ZeptoStatic();

Parameters

  • element: HTMLElement

Returns

ZeptoCollection

(htmlString: string): ZeptoCollection

see

ZeptoStatic();

Parameters

  • htmlString: string

Returns

ZeptoCollection

(htmlString: string, attributes: any): ZeptoCollection

see

ZeptoStatic();

Parameters

  • htmlString: string
  • attributes: any

Returns

ZeptoCollection

(object: any): ZeptoCollection

see

ZeptoStatic();

Parameters

  • object: any

Returns

ZeptoCollection

Properties

public ajaxSettings: ZeptoAjaxSettings

Object containing the default settings for Ajax requests. Most settings are described in $.ajax. The ones that are useful when set globally are:

example
timeout (default: 0): set to a non-zero value to specify a default timeout for Ajax requests in milliseconds
global (default: true): set to false to prevent firing Ajax events
xhr (default: XMLHttpRequest factory): set to a function that returns instances of XMLHttpRequest (or a compatible object)
accepts: MIME types to request from the server for specific dataType values:
    script: “text/javascript, application/javascript”
    json: “application/json”
    xml: “application/xml, text/xml”
    html: “text/html”
    text: “text/plain”

public browser: { version: string; chrome: boolean; firefox: boolean; silk: boolean; playbook: boolean; }

The following boolean flags are set to true if they apply, if not they're either set to 'false' or 'undefined'. We recommend accessing them with !! prefixed to coerce to a boolean.

public browser.chrome: boolean

Specific browser

public browser.firefox: boolean

public browser.playbook: boolean

public browser.silk: boolean

public browser.version: string

Browser version.

public fn: any

Zepto.fn is an object that holds all of the methods that are available on Zepto collections, such as addClass(), attr(), and other. Adding a function to this object makes that method available on every Zepto collection.

public fx: ZeptoEffects

Global settings for animations.

public os: { version: string; phone: boolean; tablet: boolean; ios: boolean; android: boolean; webos: boolean; blackberry: boolean; bb10: boolean; rimtabletos: boolean; iphone: boolean; ipad: boolean; touchpad: boolean; kindle: boolean; }

The following boolean flags are set to true if they apply, if not they're either set to 'false' or 'undefined'. We recommend accessing them with !! prefixed to coerce to a boolean.

public os.android: boolean

public os.bb10: boolean

public os.blackberry: boolean

public os.ios: boolean

Specific OS

public os.ipad: boolean

public os.iphone: boolean

Specific device type

public os.kindle: boolean

public os.phone: boolean

General device type

public os.rimtabletos: boolean

public os.tablet: boolean

public os.touchpad: boolean

public os.version: string

OS version.

public os.webos: boolean

Methods

public Event(type: string, properties: any): Event

Create and initialize a DOM event of the specified type. If a properties object is given, use it to extend the new event object. The event is configured to bubble by default; this can be turned off by setting the bubbles property to false. An event initialized with this function can be triggered with trigger.

Parameters

  • type: string
  • properties: any

Returns

Event

public ajax(options: ZeptoAjaxSettings): XMLHttpRequest

Perform an Ajax request. It can be to a local resource, or cross-domain via HTTP access control support in browsers or JSONP. Options: type (default: “GET”): HTTP request method (“GET”, “POST”, or other) url (default: current URL): URL to which the request is made data (default: none): data for the request; for GET requests it is appended to query string of the URL. Non-string objects will get serialized with $.param processData (default: true): whether to automatically serialize data for non-GET requests to string contentType (default: “application/x-www-form-urlencoded”): the Content-Type of the data being posted to the server (this can also be set via headers). Pass false to skip setting the default value. dataType (default: none): response type to expect from the server (“json”, “jsonp”, “xml”, “html”, or “text”) timeout (default: 0): request timeout in milliseconds, 0 for no timeout headers: object of additional HTTP headers for the Ajax request async (default: true): set to false to issue a synchronous (blocking) request global (default: true): trigger global Ajax events on this request context (default: window): context to execute callbacks in traditional (default: false): activate traditional (shallow) serialization of data parameters with $.param If the URL contains =? or dataType is “jsonp”, the request is performed by injecting a