在对象上初始化插件时,如本示例所示; $('.selector').somePlugin()
。
插件函数someFunction定义为:
function Plugin(e) {
...
}
$.extend(Plugin.prototype, {
someFunction: function() {
...
}
}
$.fn.Plugin = function(){
return this.each(function(){
if(!$.data(this, 'plugin')){
$.data(this, 'plugin', new Plugin(this));
}
});
});
是否可以运行" someFunction"做类似$('.selector').someFunction()
的事情?
答案 0 :(得分:0)
您正在使用的插件Fotorama有API文档。它在这里找到:API那里有一个例子:
SELECT qt.QueueName AS [Queue]
,COUNT(CASE
WHEN dq.IsProcessed = 0
AND dq.PageNumber = 1
THEN qt.QueueName
END) AS [#ofUnprocessedEnvelopes]
,COUNT(CASE
WHEN dq.AssignedToUserID = 0
AND dq.IsProcessed = 0
AND dq.PageNumber = 1
THEN 1
ELSE NULL
END) AS [#ofUnassignedEnvelopes]
,MIN(CASE
WHEN dq.IsProcessed = 0
AND dq.PageNumber = 1
THEN dq.DocumentDate
END) AS [OldestEnvelope]
FROM dbo.VehicleReg_Documents_QueueTypes AS [qt]
LEFT OUTER JOIN dbo.VehicleReg_Documents_Queue AS [dq] ON dq.QueueID = qt.QueueTypeID
GROUP BY qt.QueueName
ORDER BY qt.QueueName ASC;
一系列方法。其中之一是:
fotorama.requestFullScreen() 如果在选项中允许,则以全屏模式打开fotorama。
我建议按照该API中的说明进行操作。