我有一個jQuery插件tzineClock。但是當我試圖叫它jquery函數不支持
$(document).ready(function(){
/* This code is executed after the DOM has been completely loaded */
$('#fancyClock').tzineClock();
});
它是拋出錯誤爲「此功能不支持」。任何人都可以告訴我錯誤可能是什麼?這是tzineClock代碼:
$.fn.tzineClock = function(opts){
// "this" contains the elements that were selected when calling the plugin: $('elements').tzineClock();
// If the selector returned more than one element, use the first one:
var container = this.eq(0);
if(!container)
{
try{
console.log("Invalid selector!");
} catch(e){}
return false;
}
if(!opts) opts = {};
var defaults = {
/* Additional options will be added in future versions of the plugin. */
};
/* Merging the provided options with the default ones (will be used in future versions of the plugin): */
$.each(defaults,function(k,v){
opts[k] = opts[k] || defaults[k];
})
// Calling the setUp function and passing the container,
// will be available to the setUp function as "this":
setUp.call(container);
return this;
}
哪個功能?當你試圖打電話給tzineClock?你能告訴我們調用它的代碼嗎? – Rup
$(文件)。就緒(函數(){ \t/*這個代碼在DOM之後執行已被完全裝入*/ \t $( '#fancyClock')tzineClock(); }); – Nagarajan
我只在這裏打電話 – Nagarajan