我正在使用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