1
我试图在显示其他按钮时使用jQuery显示按钮。但我不是一个jQuery专家。所以我想知道是否有人能帮助我解决这个问题?仅当显示按钮B时才显示按钮-A
我有2个按钮:
- 按钮
ent-step
- 按钮
del-step
我想要做的是只显示按钮ent-step
当按钮del-step
在屏幕上。通常情况下这个按钮del-step
隐藏与这个JavaScript:
function showDellocation($this) {
var dataLocation = $this.attr("data-location");
$(".del-step[data-location='" + dataLocation + "']").show();
$(".add-step[data-location='" + dataLocation + "']").addClass("blur");
}
function hideDellocation($this) {
var dataLocation = $this.attr("data-location");
$this.hide();
$(".add-step[data-location='" + dataLocation + "']").removeClass("blur");
}
按钮ent-step
是阿贾克斯称为其他PHP文件:
<table class="item-buttons">
<tr>
<td style="width:150px;"> </td>
<td style="width:150px;">
<a href="example.com/step" value="Ent">
<button class="ent-step">Entertainment
<i class="fa fa-angle-double-right" aria-hidden="true">/i>
</button>
</a>
</td>
</tr>
</table>
我可以使用blur
类来激活这个选项?例如:
jQuery(document).ready(function($) {
if ($(this).hasClass('blur')) {
$('.ent-step').addClass('clickable');
}
然后使用CSS风格的按钮? 或者这不是正确的方法吗?
我不明白'ENT一步按钮'在你的代码中。 – eisbehr
$(“。del-step [data-location ='”+ dataLocation +“']”)。show();你可以显示** ent-step **,像$(“。ent-step”)。show(); –