csdn文章的显示与折叠,在编辑器中点击源视图:
1.添加自己的代码
<!-- 添加自己的代码-->
<DIV style="BORDER-RIGHT: 1px; BORDER-TOP: 1px; BORDER-LEFT: 1px; CURSOR: hand; BORDER-BOTTOM: 1px" οnclick=toggle(this,'myContent')>+Code</DIV>
<SCRIPT type=text/javascript>
function toggle(obj,id){
var content = document.getElementById(id);
if(content.style.display == 'none'){
content.style.display = 'block';
obj.innerHTML = '-Code';
}else{
content.style.display = 'none';
obj.innerHTML = '+Code';
}
}
</SCRIPT>
2.给div添加id属性、style属性
<!-- 以下是文章内容,根据需要给div添加id属性、style属性 -->
<DIV class=highlighter id=myContent style="DISPLAY: none"> ... </div>