【发布时间】:2020-07-23 08:57:43
【问题描述】:
单击下拉列表中的选项卡时正在关闭,然后再次单击下拉选项卡时会更改。使用wordpress,波尔图主题。代码如下。怎么了?
<div class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="tmarketst"><i class="porto-icon-user-2" ></i></span> My Profile
</a>
<div class="dropdown-menu">
<ul class="nav nav-tabs" id="myTab">
<li class="active"><a data-target="#home" data-toggle="tab">Log in </a></li>
<li><a data-target="#profile" data-toggle="tab">Register</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="home"><?php echo do_shortcode("[wc_login_form_mmy]"); ?> </div>
<div class="tab-pane" id="profile"><?php echo do_shortcode("[wc_reg_form_mmy]"); ?></div>
</div>
</div>
</div>
$( document ).ready(function() {
$('.dropdown-menu li').on('click', function(event){
//The event won't be propagated to the document NODE and
// therefore events delegated to document won't be fired
event.stopPropagation();
});
$('.dropdown-menu li').on('click', function(event){
//The event won't be propagated to the document NODE and
// therefore events delegated to document won't be fired
event.stopPropagation();
});
$('.dropdown-menu > ul > li > a').on('click', function(event){
event.stopPropagation();
$(this).tab('show')
});
});
【问题讨论】:
标签: javascript php html jquery wordpress