var path = window.location.pathname; // Returns path only
var element = jq_menu("#topMenu a[href='" + path + "']");
element.parent().closest('li').addClass('active');
이 코드를 선택 메뉴에 사용합니다.선택기 조건에서 toLowerCase를 사용하는 방법 jQuery에서
나는
내가 어떻게 할 수 있습니다
2 줄에서lowerCase
에
href
값을 변환하려면?
'path'는 문자열입니다. 그래서 ...'path.toLowerCase()'O.o – Andreas
'path.toLowerCase()'를 시도해 보셨습니까? – Rajesh
이것은 적절한 질문으로 여겨지지 않습니다. 사람들이 계속 그런 질문을한다면 그것은 수조조 이상의 질문이 될 것입니다. 'toLowerCase()'함수를 사용하지 않았습니까? –