[英]How to change the button text from show to hide after click, and also keep it showen after slide up?
i'm trying to do something similler to the map you can see at the end of this site, http://www.insegment.com/ 我正在尝试用similler做一些你可以在本网站末尾看到的地图, http://www.insegment.com/
Here's the html 这是html
<div class="clear">
<button id=slideToggle>Show full map</button>
<div class="slideTogglebox">
</div> </div>
Script: 脚本:
$("#slideToggle").click(function () { $('.slideTogglebox').slideToggle(500); });
Thank's in advance 提前致谢
Do... 做...
$("#slideToggle").click(function () {
$(this).html(($(this).html()=="Show full map"?"Hide map":"Show full map"));
// To move up
$(this).toggleClass("moveUp");
$('.slideTogglebox').slideToggle(500);
});
And put the css
to move up in moveUp
然后把css
放到moveUp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.