2009-08-05 5 views
0

sifr出力を操作しようとしました。私はそれの前に何らかの弾丸を追加したい(»)。 sifr 3 wikiにメソッド「modifyContentString」が見つかりました。しかし、私は内容を得ることができません。私が受け取るのは[オブジェクトウィンドウ]だけです。何が悪かったのか?modifyContentStringは "real"コンテンツの代わりに[object Window]を返します

sIFR.replace(myFont, { 
    selector: '#sidebar li', 
    modifyContentString: function test() { return content; }, 
    css: [ 
     '.sIFR-root {font-size: 10px; text-transform: uppercase; }', 
     'a { text-decoration: none; }', 
     'a:link { color: #333333; }', 
     'a:hover { color: #9d9ea1; text-decoration: underline }' 
    ] 
}); 

答えて

2

sIFRドキュメントはmodifyContentString 2つのパラメータ、コンテンツ、及びセレクタをとりコールバックにかかると述べています。あなたのコールバックは引数を受け付けません。ランダム変数を参照するだけです。

次のことを試してみてください。

sIFR.replace(myFont, { 
    selector: '#sidebar li', 
    modifyContentString: function test(content, selector) { return content; }, 
    css: [ 
     '.sIFR-root {font-size: 10px; text-transform: uppercase; }', 
     'a { text-decoration: none; }', 
     'a:link { color: #333333; }', 
     'a:hover { color: #9d9ea1; text-decoration: underline }' 
    ] 
}); 

乾杯!

+0

それでした!どうもありがとうございました。 – gefangenimnetz

関連する問題