2013-06-21 21 views
2

有誰知道如何讓JustGage對象響應? 請檢查下面的鏈接,我解決這個問題有拉斐爾,但不能得到做同樣的JustGage:Responsive JustGage JAUGE

window.onload = function() { 
    var g1 = new JustGage({ 
    id: "g1", 
    value: getRandomInt(0, 4000), 
    min: 0, 
    max: 4000, 
    title: "Well over thousand", 
    label: "" 
    }); 
} 

http://jsfiddle.net/ugFmE/

回答

3

只需在添加relativeGaugeSize: true到您的代碼

無需固定高度

#g1 { 
    /* width: 400px; */ 
    /* height:300px; */ 
} 

腳本

var g1 = new JustGage({ 
    id: "g1", 
    value: getRandomInt(0, 4000), 
    min: 0, 
    max: 4000, 
    title: "Well over thousand", 
    label: "", 
    relativeGaugeSize: true 
}); 

http://jsfiddle.net/ugFmE/10/

+2

隨着2015年5月,一「工作正在進行,未發行的,非官方的代碼」必須用於relativeGaugeSize特點寫在http://justgage.com/justgage.js的頭。請參閱http://justgage.com/demos/responsive-gauges/上的演示。 – pba