see I have a list within my kentico project which contains elements (pages) and sub-elements (sub pages), and I want that whenever I click on a sub element link within a parent element, the website redirects to the link clicked and show the list with the parent element expanded. now this feature is working but other elements are also expanding by themselves without pressing on their links or expanding their parent element. this is my javascript code:
<script type="text/javascript">
var parent_document_name = '<%=CMS.DocumentEngine.DocumentContext.CurrentDocument.Parent.DocumentName%>';
$('#AsideNav a:contains("' + parent_document_name + '")').addClass('active');
$('#AsideNav a:contains("' + parent_document_name + '")').parents().addClass('active');
</script>
Can you figure out whats the problem? please note that I am new to Javascipt.