我有這個倒計時如何創建一個函數以在JavaScript插件中返回值?
(function($){
var options = {
display_as_text : false,
remaining : 0,
separator : ':',
significant_days : 3,
display_on_complete : null, // id of element to display when countdown is complete
hide_on_complete : null // hide the timer once it hits zero
};
$.fn.countdown = function (config_options)
{
/*
* Initialise
*
* Prepare data and trigger regular execution of code
*
* @param container Reference to DOM element where counter will be displayed
*/
var initialise = function (container){
}
var update = function (seconds_remaining){
}
,我需要訪問更新和重置基於值我發送的時間,但我不知道如何訪問它。下面是我如何實例化插件
$('#timer').countdown({remaining : 1000});
但我如何調用更新來更新秒......我試着將它設置爲一個變量,並調用它,但沒有去...任何想法