Hej jeg er igang et et Tree Menu.. Men jeg kan ikke få åbnet og lukket de rigtige med jquery... ??
Hej eksperten.dkjeg er igang et et Tree Menu.. Men jeg kan ikke få åbnet og lukket de rigtige med jquery... ??
Håber i har lyst til at kigge lidt på det... Fordi jeg er løbet tør for ideér til hvordan man kan
lave det...
<!DOCTYPE html>
<html>
<head>
<title>ProwTree</title>
<meta name="prowtree" content="content">
<script src="http://code.jquery.com/jquery-1.4.4.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("li a#child").hide();
$(".callul").click(function() {
var CallParentId = "#" + $(this).attr("ParentId");
var CallChildId = "#" + $("li a#child").attr("ChildId");
if(CallParentId == CallChildId){
$("li a#child:first").toggle();
}
});
});
</script>
</head>
<body id="prowtree">
<div id="prowtree_container">
<div id="prowtree">
<ul id="ul1">
<li id="ul1"><a class="callul" href="#" ParentId="ul1">Parent 1</a></li>
<ul>
<li><a href="#" id="child" ChildId="ul1">Child 1</a></li>
</ul>
</ul>
<ul id="ul2">
<li id="ul2"><a class="callul" href="#" ParentId="ul2">Parent 2</a></li>
<ul>
<li><a href="#" id="child" ChildId="ul2">Child 2</a></li>
</ul>
</ul>
<ul id="ul3">
<li id="ul3"><a class="callul" href="#" ParentId="ul3">Parent 3</a></li>
<ul>
<li><a href="#" id="child" ChildId="ul3">Child 3</a></li>
</ul>
</ul>
</div>
</div>
</body>
</html>
Den kan kun åbne den øverste...
I kan se det på min hjemmeside:
http://prowcms.prowdesign.dk/prowcms/prowTree.php
Tak for det.. ;P
