Faol bo'lmagan yorliqlarni qanday qilib ajratish mumkin?

Bu yorliqlarim bor, lekin boshqa faol bo'lmagan yorliqlarni chizilmasligi mumkinmi?

<div class="navbar">
   <div class="navbar-inner">
      
      </div>
  </div>
0
href atributini olish haqida nima deyish mumkin?
qo'shib qo'ydi muallif sandrooco, manba
Kodingizning yuqorisida biron-bir ramka (va versiya) dan foydalanayotgan bo'lsangiz, tag deb belgilash muhimdir. Masalan, ushbu belgilanish bootstrap kodiga o'xshaydi, lekin men v3x yoki v4 ekanligini bilmayman. Ushbu kuzatuv, ko'pgina ramkalar allaqachon turli harakatlar (bu holatda) o'chirib qo'yish holatini amalga oshirish uchun usullarni yaratganligi sababli bo'ladi.
qo'shib qo'ydi muallif gmo, manba
jQuery - o'chirishni o'chirish mumkin bo'lgan dublikati
qo'shib qo'ydi muallif gus27, manba

6 javoblar

: not() -ni tanlashingiz mumkin: pointer-events: none; .

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

li:not(.active)  a{
pointer-events: none;
}
<div class="navbar">
   <div class="navbar-inner">
      
      </div>
  </div>
</div> </div>

1
qo'shib qo'ydi

Faol bo'lmagan narsalarga ularni ochib olish uchun quyidagi qoidalarni qo'shishingiz mumkin. Bu quyidagi maqolada tavsiya etilgan:

Barcha div tarkibini qanday o'chirib qo'yish kerak

.disabled, li:not(.active) {
  pointer-events: none;
  opacity: 0.4;
}

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

ul {
  display: inline-flex;
  width: 100%;
  list-style-type: none;
  margin: 0;
  padding: 0;
  height: 1em;
  line-height: 1em;
}

li {
  width: 14%;
  height: 2em;
  margin: 0.1%;
  line-height: 2em;
  background-color: #FFF;
  border: thin solid #777;
  text-align: center;
}

li a {
  display: block;
  width: 100%:
  height: 100%;
  text-decoration: none;
}
li a, li a:active, li:visited {
  color: #48A;
}
li a:hover {
  color: #5AC;
  text-decoration: underline;
}
.active {
  background-color: #FFF;
  font-weight: bold;
  border: thin solid #DDD;
}

.disabled, li:not(.active) {
  background-color: #AAA;
  pointer-events: none;
  opacity: 0.4;
}
<div class="navbar">
  <div class="navbar-inner">
    
  </div>
</div>
</div> </div>

0
qo'shib qo'ydi

Eng yaxshi natijaga erishish uchun quyidagilarni amalga oshirishingiz mumkin:

  1. Add the disabled class to the li element
  2. Remove the data-toggle attribute for the a

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<div class="navbar">
   <div class="navbar-inner">
      
      </div>
  </div>
</div> </div>

0
qo'shib qo'ydi

Jquery yordamida chertgan havolalarni o'chirish uchun harakat qilib ko'ring:

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

$(document).ready(function(){
    $("a").click(function(event){
        event.preventDefault();
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
Go to google
</div> </div>
0
qo'shib qo'ydi

Shunchaki, ushbu klassni sekin urishlarni o'chirib qo'yish kerakli ichki oynalarga kiriting. Mana CSS.

.avoid-clicks {
 pointer-events: none;
}
0
qo'shib qo'ydi

ularning hammasini o'chirib qo'ying va faolni faollashtiring

$('li').prop('disabled',true);
$('.active').prop('disabled',false);
0
qo'shib qo'ydi
Javascript UZB
Javascript UZB
99 ishtirokchilar

@js_uzb @vuejs_uz @react_uz @nodejs_uz @angular_uz @ngTashkent @yiiframework_uz @laravel_uz @linux_uzbek @python_uz @swift_uzb —————— @uzdevgroup @UzGeeksGroup ——— @UzDev_Jobs @jobs_uzb