readyX

授权协议 未知
开发语言
所属分类 jQuery 插件、 其他jQuery插件
软件类型 开源软件
地区 不详
投 递 者 穆正祥
操作系统 未知
开源组织
适用人群 未知
 软件概览

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:

  1. The first call to readyX prepends a readyX callback to jQuery.readyList. Basically, the callback cuts to the beginning of the line.
  2. 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
  3. once the readyX callback is called by jQuery's ready handler, it fires the special callback first.
  4. items in the readyX list are executed.
  5. the special last callback is binded to the document and will run after jQuery readyList is complete.
  6. readyX's list and the special first/last are reset
  7. jQuery.ready runs through jQuery readyList.
  8. any bound ready event handlers are executed, including the last callback.

相关阅读

相关文章

相关问答

相关文档