我为“阅读更多.../阅读更少...”编写了一个.slideToggle的代码,问题在于在滑动结束时,动画会“跳动”,缺乏更好的描述。同样,在重新开始滑动时也会出现此问题。有什么建议吗?
编辑:我正在使用Chrome浏览器
<div class="details">
<p>I am an excerpt.</p>
<span class="show">Read More...</span>
<div class="info">
<p>the info to show in here......</p>
</div>
</div> <!-- details -->
<div class="details">
<p>I am an excerpt.</p>
<span class="show">Read More...</span>
<div class="info">
<p>Some different info to show in here......</p>
</div>
</div> <!-- details -->
$(document).ready(function (){
$(".info").hide();
$(".show").click(function(event) {
$(this).parent(".details").children("div.info").slideToggle(300);
$(this).text($(this).text() == 'Read More...' ? 'Read Less...' : 'Read More...');
});
});
谢谢!