我正在尝试在onNext事件中的按钮上触发click()函数。
{
element: "#action_header",
title: "Saving to database",
content: "After you declare the result .. ",
placement: "left",
onNext: function() {
$('.dropdown-toggle').click();
}
},
{
element: "#slideshow",
title: "Settings",
content: "Click on the Settings icon... ",
placement: "left",
// delay: 200,
// onShow: function() {
// $('.dropdown-toggle').click();
// }
},
But this will only highlight the button and show the `next step modal` elsewhere instead of specified element.下面是html:
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i></button>
<ul class="dropdown-menu" role="menu">
<li class="active"><a id="detail_view" href="javascript:;">Detail View</a></li>
<li><a id="slideshow" href="javascript:;" onclick="adminSlideshowRedirect();">Slideshow</a></li>
</ul>
</div>当我从控制台触发$('.dropdown-toggle').click()时,按钮被正确地点击了。
我在这里做错了什么?
发布于 2020-12-03 13:22:34
问题是你的下拉列表被点击了,但由于你的下拉列表的onBlur切换,它又被切换了。您需要删除onBlur切换,它将正常工作。
https://stackoverflow.com/questions/65120076
复制相似问题