【发布时间】:2016-10-14 18:42:21
【问题描述】:
当我点击“更多”时,它可以工作,但屏幕会显示在顶部。它最后也显示“关闭”。再次单击关闭后,它仍然是“关闭”。我希望它返回“更多”。我该怎么做?
<p class="disp-cont">
Several Australian home owners have been utilizing the services of mortgage brokers to fulfill their dreams of owning a house at an affordable rate.
</p>
<p class="more-cont" style="display:none;">
Whether you are aspiring to buy a new house or considering upgrading your existing home loan, an expert mortgage broker can help you achieve your objective in the simplest and easiest way! For the uninitiated, here’s a sneak peek on <strong>what is mortgage broking?</strong><br>
Mortgage broking involves the act of intermediating between the borrower and the lender (bank & non-bank). While on one hand, the loan specialist assists the borrower to qualify for a mortgage, on the other hand, he negotiates with the lender on the borrower’s behalf. The role of mortgage broker starts right from the time when you plan to explore your options of financing/refinancing till the deal is finalized.
</p>
<a href="#" class="more">more</a>
$('.more').click(function() {
$(this).prev('.more-cont').slideToggle();
$(this).html('close');
});
【问题讨论】:
-
请添加一个有效的 jsfiddle
-
我正在学习 jquery。什么是 jsfiddle
-
看起来你被分配了一个任务。这是小提琴:jsfiddle.net
-
它是一个非常棒的在线原型设计 html/css/js 的工具。您可以保存草稿并与其他人共享链接,例如 stackoverflow。 jsfiddle.net
-
所以我必须在这做些什么
标签: jquery