シンボルをクリックしたときにテキストを最小化および最大化するためのコードを作成しました。私は次のことを試しました:
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 を最大化し、残りのすべてのテキストを表示する必要があります。また、[+] 記号を [-] 記号に置き換える必要があります。これにより、テキストが最小化されます。
誰でも私を助けることができますか?