I have this below code that loads a tree menu:
$(document).ready(function () {
$(".treeview li>ul").css('display', 'none'); // Hide all 2-level ul
$(".Treeviewcollapsible").click(function (e) {
e.preventDefault();
$(this).toggleClass("Treeviewcollapse Treeviewexpand");
$(this).closest('li').children('ul').slideToggle();
});
});
it renders a bunch of html links like
<a url... </a>
But i need it to render them with an anchor class for all levels so something like
<a class="menu" url.... </a>
Can someone please help with that?
I want to then use the below, or join the below with the top to load a partial page without reloading the rest to maintain the tree menu state
$(document).ready(function(){
$("a.menu").click(function(e){
e.preventDefaul(); // prevent default link button redirect behaviour
var url=$(this).attr("href");
$('#page-content').load(url);
});
});
EDIT
found where the html was rendering and put it in there, sorry obvious solution but new to this!