readyX 介绍
readyX extends the jQuery(document).ready event to permit greater control of
the order in which the ready event callbacks get executed. readyX provides
three queues instead of jQuery’s one.
The queues are:
- first : single function that runs as the very first callback
- last : single function that runs as the very last callback
- list : array of functions that are run sequentially between the first and last callbacks. callbacks in jQuery.readyList are appended to the end of the array for executing.
The sequence of actions that readyX takes are:
- The first call to readyX prepends a readyX callback to jQuery.readyList. Basically, the callback cuts to the beginning of the line.
- readyX has an independent list that is controlled by instructions provided when readyX is called. The available instructions are:
- commands for first and last queues:
- first : assigns a callback as the very first item to run. this callback is NOT part of the list controlled the commands below
- last : assigns a callback as the very last item to run. this callback is NOT part of the list controlled the commands below
- commands for list queue:
- insert : inserts a callback at a specified position. if a callback is already present at that position, it is pushed back by one.
- replace : replaces a callback with another at a specified position
- delete : deletes a callback at a specified position
- prepend : adds callback to the beginning of the readyX list
- append : default action. adds callback to the end of the readyX list
- once the readyX callback is called by jQuery’s ready handler, it fires the special callback first.
- items in the readyX list are executed.
- the special last callback is binded to the document and will run after jQuery readyList is complete.
- readyX’s list and the special first/last are reset
- jQuery.ready runs through jQuery readyList.
- any bound ready event handlers are executed, including the last callback.
readyX 官网
http://plugins.jquery.com/project/readyx
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。