为readmore下拉菜单添加图像
Add image for readmore drop down
我想知道如何为这个脚本添加下拉图像。
<a onclick="showMoreOrLess(this,'restOfArticle');">+Sign In </a>
<span id="restOfArticle" style="display:none"> </span>
脚本
<script>function showMoreOrLess(thisObj, bonusContent) {
var caption = thisObj.innerHTML;
//alert(caption);
if (caption == "+Sign In") {
document.getElementById(bonusContent).style.display = "inline";
thisObj.innerHTML = "-Sign In";
} else {
document.getElementById(bonusContent).style.display = "none";
thisObj.innerHTML = "+Sign In";
}
}
</script>
我想用小图像图标代替+和-,怎么做?
删除+
或-
符号。添加一个类到锚,然后使用:before
伪选择器。