【发布时间】:2013-09-23 22:51:12
【问题描述】:
刚刚为 .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...');
});
});
谢谢!
【问题讨论】:
标签: jquery slidetoggle