我编写了用于最小化和最大化文本的代码,当我们单击符号时。我曾尝试以下:使用javascript最小化和最大化文本
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上述具有显示出 “指令” 和 “[+]”。当我点击“[+]”符号时,它必须最大化div并显示所有剩余的文本。此外,[+]符号必须替换为[ - ]符号,这将使文本最小化。
任何人都可以帮助我吗?
你可以简单解释一下 – lucky 2012-07-24 15:54:42
对不起,在这里,我想用jquery – lucky 2012-07-24 18:09:59