久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 jQuery UI 小部件中的 _init 和 _create 之間做

How to decide between _init and _create in jQuery UI widget?(如何在 jQuery UI 小部件中的 _init 和 _create 之間做出決定?)
本文介紹了如何在 jQuery UI 小部件中的 _init 和 _create 之間做出決定?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想我了解小部件定義中 _create_init 之間的區別(例如,請參閱 this question),但我仍然不確定區分的目的._create()_init() 中有哪些類型的設置任務?如果widget作者選錯了會出現什么問題?

I think I understand the difference between _create and _init in widget definitions (see for instance this question), but I'm still not certain about the purpose for the distinction. What sorts of setup tasks go in _create() or in _init()? What goes wrong if the widget author chooses the wrong one?

推薦答案

來自:

  • http://forum.jquery.com/topic/jquery-ui-1-8-use-of-init
  • http://www.erichynds.com/jquery/tips-for-開發-jquery-ui-widgets/
  • http://jqueryui.com/demos/dialog/

使用 _create 構建和注入標記、綁定事件等放置_init() 中的默認功能.對話框小部件,例如,提供 autoOpen 參數表示對話框是否小部件打開后應該打開初始化;一個完美的地方_init()!

Use _create to build and inject markup, bind events, etc. Place default functionality in _init(). The dialog widget, for example, provides an autoOpen parameter denoting whether or not the dialog should be open once the widget is initialized; a perfect spot for _init()!

還有:

小部件工廠自動觸發_create()_init() 方法在初始化期間,按此順序.乍一看似乎努力是重復的,但有一個兩人的視線差異.因為小部件工廠保護針對多個實例化相同的元素,_create() 將是每次最多調用一次小部件實例,而 _init() 將每次小部件被調用不帶參數調用...

The widget factory automatically fires the _create() and _init() methods during initialization, in that order. At first glance it appears that the effort is duplicated, but there is a sight difference between the two. Because the widget factory protects against multiple instantiations on the same element, _create() will be called a maximum of one time for each widget instance, whereas _init() will be called each time the widget is called without arguments...

如果作者在 _create() 應該被編碼時使用 _init(),結果將是 _init() 將在每個小部件實例化時執行一次.

If the author uses _init() when _create() should have been coded, the result will be that the code in _init() will be executed once per widget instantiation.

這篇關于如何在 jQuery UI 小部件中的 _init 和 _create 之間做出決定?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設置值/標簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 久久久免费观看视频 | 久久亚洲国产精品日日av夜夜 | 午夜电影网 | 日韩成人在线网站 | 亚洲色图第一页 | 国产精品成人国产乱一区 | 亚洲精品2区| 久久久久久免费毛片精品 | 国产成人影院 | 国产在线观看av | 人妖av | 日日碰狠狠躁久久躁婷婷 | 国产精品九九视频 | 国产精品久久久久久吹潮日韩动画 | 视频一区二区在线观看 | 久草在线在线精品观看 | 亚洲欧美综合 | 久久久久久国产精品免费免费狐狸 | 在线成人 | 亚洲精品一区中文字幕乱码 | 伊人精品一区二区三区 | 欧美一级免费片 | 中文日韩在线 | 成人国产一区二区三区精品麻豆 | 一区二区在线观看免费视频 | 手机看片1 | 欧美.com| 国产乱人伦 | 蜜桃视频在线观看免费视频网站www | av国产精品 | 久久国产成人午夜av影院武则天 | 伊人久久大香线 | 国产日韩精品久久 | 亚洲免费在线观看 | 国产精品视频免费观看 | 欧美日韩在线精品 | 一级女毛片 | 亚洲最新网址 | 免费黄色大片 | 蜜桃官网 | 亚洲精品乱码久久久久v最新版 |