我正在使用jQuery切換顯示/隱藏按鈕。有沒有一種方法來整合SVG圖標(在這種情況下,Octicons)?與jQuery切換使用SVG圖標
$(function() {
$('.show-button').click(function(){
$(this).text(function(i,old){
return old=='Show less' ? 'Show more {% octicon chevron-down height:25 class:"right left" aria-label:toggle %}' : 'Show less';
});
});
});
眼下,這個輸出:
[ Show more <svg height="25" class="octicon octicon-chevron-down right left" aria-label="toggle"...]
謝謝!
非常感謝(對於答案和標準提示)! – bunnycode
@bunnycode,謝謝!我很高興我可以使用。 – Pyromonk