我在bootstrap.js代碼(從Twitter)
!function($) {
$(function() {
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
$.support.transition = (function() {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support && {
end: (function() {
var transitionEnd = "TransitionEnd"
if ($.browser.webkit) {
transitionEnd = "webkitTransitionEnd"
} else if ($.browser.mozilla) {
transitionEnd = "transitionend"
} else if ($.browser.opera) {
transitionEnd = "oTransitionEnd"
}
return transitionEnd
}())
}
})()
})
}(window.jQuery);
然而,$ .browser從jQuery的1.9明顯移除..
我怎樣才能重新編寫這個片段?
該文檔說使用$.support,但我不知道如何。
modernizer.js .. google it .. :) – bipen
此屬性在jQuery 1.9中被刪除,並且只能通過jQuery.migrate插件提供。請嘗試改用功能檢測。 – Tdelang