【发布时间】:2012-02-01 04:57:18
【问题描述】:
我有一个我正在开发的网站http://trueproperty.org/,在首页我有两个 div,一个是#excerpt,另一个是#content。 #content 填充使用
<?php the_excerpt(); ?> <button id="readmore">Continue Reading...</button>
并且#excerpt 填充使用
<?php the_content(); ?>.
内容设置为display:none。现在我使用此代码显示#content 并在用户单击继续阅读时隐藏#excerpt,它适用于jsbin,但不适用于actual site,我无法弄清楚:/。
<script type="text/javascript">
$(document).ready(function(){
$("#readmore").click(function(){
$('#content').show('slow');
$('#excerpt').hide('fast');
});
});
</script>
【问题讨论】:
标签: javascript jquery wordpress show-hide