簡體   English   中英

jQuery UI和Closure編譯器高級優化

[英]jQuery UI and Closure Compiler Advanced Optimizations

我正在嘗試將Closure Compiler與高級優化一起用於我的項目,我正在使用jQuery 1.11.1和jQuery UI 1.10.4。

作為jQuery的extern,我發現了jQuery 1.9的外部,我認為它可以正常工作,但是我遇到了jQuery UI的問題,我無法找到任何版本的extern。

知道任何jQuery用戶界面的任何東西嗎?

謝謝。

PS:我試過網頁http://www.dotnetwise.com/Code/Externs/但是extern生成沒有幫助: - /

我很幸運能夠創建自己的簡單externs文件。 例如,如果我只使用.draggable和.resizable,則它包含的內容如下:

 jQuery.prototype.resizable = function (arg1, arg2, arg3) { }; $.prototype.resizable = function (arg1, arg2, arg3) { }; jQuery.prototype.draggable = function (arg1, arg2, arg3) { }; $.prototype.draggable = function (arg1, arg2, arg3) { }; 

然后在我的.js文件中,在初始化時使用帶引號的字符串而不是點符號作為屬性名稱:

 // USE THIS: $(".draggable").draggable({ "axis":"x", "containment": "parent", "cursor":"move", "handle":".dragHandle", "snap":"#banner, .draggable", "snapMode":"outer" }); //INSTEAD OF THIS: $(".draggable").draggable({ axis:"x", containment: "parent", cursor:"move", handle:".dragHandle", snap:"#banner, .draggable", snapMode:"outer" }); 

沒有已知的jQuery UI extern存在。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM