pastioke.com
html

Set Active Class on Link wich same url

Ditulis oleh Tim Pasti Oke
$(function(){
    var current = location.pathname
    $('#nav li a').each(function(){
        var $this = $(this)
        // if the current path is like this link, make it active
        if($this.attr('href').indexOf(current) !== -1){
            $this.addClass('active')
        }
    })
})

Butuh solusi instan siap pakai?

Dapatkan modul & script server production-ready langsung di web store kami.

Kunjungi Toko Digital

Komentar

Belum ada komentar. Jadilah yang pertama memberikan komentar!

Kirim Komentar