【发布时间】:2013-04-05 22:30:44
【问题描述】:
我没有去挖掘,因为我认为 JustGage 有什么方法等并不重要,但我有这个新对象 g。
var g = new JustGage({
id: "gauge",
value: 34,
min: 0,
max: 100,
});
我的问题是如何在脚本后面检索 value 参数。
我认为var value = g.value 会起作用,但它不起作用。
这里是 justgage.js 文件的一部分:
JustGage = function(config) {
if (!config.id) {alert("Missing id parameter for gauge!"); return false;}
if (!document.getElementById(config.id)) {alert("No element with id: \""+config.id+"\" found!"); return false;}
var obj = this;
// configurable parameters
obj.config =
{
// id : string
// this is container element id
id : config.id,
// title : string
// gauge title
title : (config.title) ? config.title : "",
// titleFontColor : string
// color of gauge title
titleFontColor : (config.titleFontColor) ? config.titleFontColor : "#999999",
// value : int
// value gauge is showing
value : (config.value) ? config.value : 0,
【问题讨论】:
-
JustGage是如何定义的? -
初级,夏洛克!只需向我们提供
JustGage是什么:) -
文件很大,喜欢的可以去www.justgage.com看看。
-
这取决于 JustGage 如何处理传递给它的对象。如果它只是将其丢弃或未将其存储在实例的可访问属性中,则您无法获取它。
-
好了。
g.config.value.
标签: javascript graphael justgage