slide.Toggle을 사용하면서 텍스트가 움직입니다. 미리보기의 마지막 문장은 전환 할 때 바뀝니다. 미리보기 끝에 p 요소를 추가하면이 작업은 수행되지 않지만 단점은 원하지 않는 반환을 생성한다는 것입니다. 나는 그 문장이 어디에 있어야하는지 계속하고 싶다..slideToggle을 사용할 때 텍스트가 움직이지 않도록하려면 어떻게합니까?
스크립트
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".content").hide();
//toggle the componenet with class msg_body
jQuery(".heading").click(function()
{
jQuery(this).next(".content").slideToggle(1000);
});
});
</script>
HTML
<div class="layer1">
<span class="heading">During the most violent shocks of the Typhoon, the man at the Pequod's jaw-bone tiller had several times been reelingly hurled to the deck by its spasmodic motions, even though preventer tackles had been attached to it—for they were slack—because some play to the tiller was indispensable.</span>
<span class="content">In a severe gale like this, while the ship is but a tossed shuttlecock to the blast, it is by no means uncommon to see the needles in the compasses, at intervals, go round and round. It was thus with the Pequod's; at almost every shock the helmsman had not failed to notice the whirling velocity with which they revolved upon the cards; it is a sight that hardly anyone can behold without some sort of unwonted emotion.</span></div>
CSS 어떤 도움
.layer1 {
margin: 20px;
padding: 0;
color: #bfbfbf;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 1em;
line-height: 1.2em;
/* [disabled]text-align: justify; */
}
.heading {
cursor: pointer;
text-align: left;
}
.content {
padding: 0px;
margin: 0px;
clear: both;
text-align: left;
}
감사합니다.
나는 배 – Jonesopolis