日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

mootools 选择器_MooTools中的Sizzle和Peppy选择器引擎

發布時間:2023/12/20 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mootools 选择器_MooTools中的Sizzle和Peppy选择器引擎 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

mootools 選擇器

A few weeks back I touched on how you could implement the Peppy and Sizzle selector engines in MooTools. Both posts showed how to remove the default Moo engine from use and instead make each respective selector engine the one and only. It doesn't have to be that way. You could use all three engines within the page as well.

幾周前,我談到了如何在MooTools中實現Peppy和Sizzle選擇器引擎。 這兩篇文章都展示了如何從使用中刪除默認的Moo引擎,而是使每個選擇器引擎成為唯一的選擇器引擎。 不一定要那樣。 您也可以在頁面中使用所有三個引擎。

Peppy,Sizzle和Moo在一起 (Peppy, Sizzle, and Moo Together)

//assuming that the JavaScript files we brought in via simple XHTML above.../* MooTools */ var divs = $$('div');/* Sizzle */ Window.$Sizzle = function(selector){return new Elements(new Sizzle(selector)); } //sizzle usage var divs = $Sizzle('div');/* Peppy */ Window.$Peppy = function(selector){return new Elements(new peppy.query(selector)); } //Peppy usage var divs = $Peppy('div');

Why do this? Each engine has its advantages. Sizzle generally does better with Internet Explorer so if you detect that the user is using IE, you may want to use Sizzle to grab the elements instead.

為什么這樣 每個引擎都有其優勢。 Sizzle通常在Internet Explorer上做得更好,因此,如果您檢測到用戶正在使用IE,則可能要使用Sizzle來獲取元素。

In most cases the overhead of bringing in each engine makes this strategy overkill. It's definitely an option though.

在大多數情況下,引入每個引擎的開銷使該策略變得過大。 當然,這絕對是一個選擇。

翻譯自: https://davidwalsh.name/mootools-peppy-sizzle

mootools 選擇器

總結

以上是生活随笔為你收集整理的mootools 选择器_MooTools中的Sizzle和Peppy选择器引擎的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。