Jual Beli Produk Digital - Cepat, Aman, Dan Terpercaya Sejak 2012 (Ada 70698 Members, 832 Products, 4745 Topic, 13114 Comments)

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

Dibuat
Login Terakhir 6 Tahun lalu,
Telah Dilihat 1554 Kali
Ujang Rukman Mengatakan : Sultan Account
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
Assalam,.. Tambahkan script berikut di dalam tag head pada file "application/views/phpmu-sekolah/template.php" :
<script>
$(function(){
    var url = window.location.pathname, 
        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
        // now grab every link from the navigation
        $('.the-menu a').each(function(){
            // and test its normalized href against the url pathname regexp
            if(urlRegExp.test(this.href.replace(/\/$/,''))){
                $(this).addClass('active');
            }
        });
});
</script>
<style type="text/css">
	.the-menu a.active{ color:red !important; }
</style>

simpan dan selesai, lalu coba akses lagi web dan klik menu2nya. :)
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online