chunpin
9/17/2017 - 5:11 PM

add active class on to navbar link

add active class on to navbar link

$(document).ready(function() {
	// get current URL path and assign 'active' class
	var pathname = window.location.pathname;

  //var attr = urlString.split('/');  If nessasary, can split the pathname into string, 
                                    //and get the correct item from the array and do the further processing work.



	$('.nav > li > a[href="'+pathname+'"]').parent().addClass('active');
})