【发布时间】:2014-08-23 21:39:09
【问题描述】:
我想在 jQuery 可折叠的标题中放置一个按钮。
当然,当我这样做时,按下按钮也会使可折叠展开/折叠。我发现解决方案是
e.stopPropagation();
e.stopImmediatePropagation();
我从这里拿的:adding the button to the collapsible set and getting the value of the collapsible element
但是有一个问题。当可折叠项位于已加载的页面上时:
$.mobile.changePage("#second", {transition : "pop", role : "page"});
然后,使用stopPropagation 立即导致 jquery-mobile 切换到原始页面(例如索引页面)。
这是一个示例(来自上面链接中提供的 jsfiddle),它演示了我遇到的问题:http://jsfiddle.net/ga5f86mm/1/
所以重申一下,我希望能够在 jquery-mobile 可折叠的标题中放置一个按钮,而不会导致它在单击该按钮时折叠/展开。
【问题讨论】:
标签: javascript jquery jquery-mobile