谢谢帮忙分析一下,jquery 里面有一个ui.js文件这么写的意思是什么吗? 为什么(function(){})(jquery) 后面这个jquery变量是什么作用啊?
(function($) {
/*
* Rotate
*/
$.extend($.ui.tabs.prototype, {
rotation: null,
rotate: function(ms) {
var self = this;
function stop(e) {
if (e.clientX) { // only in case of a true click
clearInterval(self.rotation);
}
}
// start interval
if (ms) {
var t = this.options.selected;
this.rotation = setInterval(function() {
t = ++t < self.$tabs.length ? t : 0;
self.select(t);
}, ms);
this.$tabs.bind(this.options.event, stop);
}
// stop interval
else {
clearInterval(this.rotation);
this.$tabs.unbind(this.options.event, stop);
}
}
});
})(jQuery);