[英]Change Text on slideToggle
這是jfiddle: http : //jsfiddle.net/RHbzv/
我正在嘗試做的是,當顯示答案時,“看到更多”變成“看到更少”,但是我似乎無法正確理解。
我努力了:
$('.see_more').on('click', function(){
if ($(this).text() == 'See more'){
$(this).text('See less')
} else {
$(this).text('See more')
}
$('.answer').slideToggle('slow')
})
有任何想法嗎???
$('.see_more').on('click', function(){
if ($(this).html() == 'See more'){
$(this).html('See less')
} else {
$(this).html('See more')
}
$('.answer').slideToggle('slow')
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.