2009-08-05 6 views
0

sifr 출력을 조작하려고합니다. 나는 그것 앞에 (») 어떤 종류의 총알을 추가하고 싶다. sifr 3 wiki에서 "modifyContentString"메서드를 찾았습니다. 그러나 나는 내용을 얻을 수 없다. 내가받는 것은 [물체 창]입니다. 무엇이 잘못 되었습니까?modifyContentString은 "실제"내용 대신 [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이 content, selector라는 두 매개 변수를 사용하는 콜백을 사용한다고 나와 있습니다. 콜백은 인수를 허용하지 않습니다. 방금 임의 변수를 참조합니다.

는 다음과 같은 시도 :

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

관련 문제