【发布时间】:2019-07-25 05:59:18
【问题描述】:
我在 JQUERY Mobile 中有一个可折叠的文件,我将其用作阅读更多内容。当折叠器展开时,有一个固定按钮,屏幕底部会显示关闭,这样您就不必滚动回顶部来关闭折叠器。
我想要做的是使用屏幕底部的固定关闭按钮触发折叠关闭。我尝试过绑定方法,但缺乏经验阻碍了我的理解。
这是我正在使用的代码。
<div id="showbutton" data-role="collapsible" data-theme="b" data-transition="turn" data-content-theme="d" class="ui-shadow ui-btn-inline">
<h2>Read more</h2>
<h2 id="content">Lots and lots of content here</h2>
<footer align="center" id="closefooter" data-role="footer" data-position="fixed" data-theme="b">
<script>
$(function() {
$("#closebutton").click(function() {
console.log("ok");
$( "#showbutton" ).trigger( "closebutton" );
});
});
</script>
<a id="closebutton">close</a>
</footer>
</div>
【问题讨论】:
标签: javascript jquery html jquery-mobile