Jual Beli Produk Digital - Cepat, Aman, Dan Terpercaya Sejak 2012 (Ada 70273 Members, 828 Products, 4758 Topic, 13099 Comments)

Membuat Tanda pada menu yg aktif di tampilan user web SIKOLAG ci

Dibuat
Login Terakhir 6 Tahun lalu,
Telah Dilihat 1516 Kali
Ujang Rukman Mengatakan : Sultan Account
  1. Assalamualaikum Warahmatullahi Wabarakatuh... Mas untuk membuat tanda pada menu yg sedang aktif di tampilan user SIKOLAG bagaimana?

Ada 1 Jawaban

Bukhori Muslim
commented on 05 Mei 2018 08:49:02
  1. Assalam,.. Tambahkan script berikut di dalam tag head pada file "application/views/phpmu-sekolah/template.php" :
  2. <script>
  3. $(function(){
  4. var url = window.location.pathname,
  5. urlRegExp = new RegExp(url.replace(/\/$/,'') + "$"); // create regexp to match current url pathname and remove trailing slash if present as it could collide with the link in navigation in case trailing slash wasn't present there
  6. // now grab every link from the navigation
  7. $('.the-menu a').each(function(){
  8. // and test its normalized href against the url pathname regexp
  9. if(urlRegExp.test(this.href.replace(/\/$/,''))){
  10. $(this).addClass('active');
  11. }
  12. });
  13. });
  14. </script>
  15. <style type="text/css">
  16. .the-menu a.active{ color:red !important; }
  17. </style>
  18.  
  19. simpan dan selesai, lalu coba akses lagi web dan klik menu2nya. :)
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online