当我们单击符号时,我编写了用于最小化和最大化文本的代码。我尝试了以下方法:
html代码:
<div style="font:12px verdana;background:#fefcd9;padding:10px 10px 10px 10px;border:solid 1px lightgray;" id="text">
Instructions<span id="min" style="cursor:pointer;float:right;">[+]</span><span id="max" style="cursor:pointer;float:right;">[-]</span><br/><br/>
Perhaps you should look for someone who will dig deep to learn about you, your business, your services and products. A writer who will put herself in the shoes of your potential customers in order to answer these important questions:hhhhhhhh
</div>
javascript:
<script type="text/javascript">
$('#text').click(function(){
$("#min").toggle(200);
$("#max").toggle(200);
});
</script>
在上面的第一个 div 中必须显示“instructions”和“[+]”。当我单击“[+]”符号时,它必须最大化 div 并显示所有剩余的文本。此外,[+] 符号必须替换为 [-] 符号,这将最小化文本。
谁能帮我?