javascript - Jquery simple slide menu not working -
i'm trying panel menu work. i've been working on hours without success. have partially working. see fiddle here.
what i'm trying is:
when click target 1, target 2, target 3 links. div holding these links should slide out. right now, being covered , hidden next div sliding in. slide out first left, , have next div slide in after.
after clicking 1 of target links. when clicking "main menu" link, make "target" box below (green, red, yellow boxes) slide out right left , have "target menu" 1 loads initially, slide in left. right now, can't "main menu" link anything. should show initial target menu when clicked.
i know there lot of right , left stuff in there. wanted specific possible. i'm not concerned direction of slide. more concerned make work first.
<div class="main-menu"><a href="#target0">main menu link</a> </div> <div id="right" id="target0"> target menu<br /> <a href="#target1" class="panel">target 1</a><br/> <a href="#target2" class="panel">target 2</a><br/> <a href="#target3" class="panel">target 3</a><br/> <div class="panel" id="target1" style="background:green">target 1</div> <div class="panel" id="target2" style="background:red">target 2</div> <div class="panel" id="target3" style="background:yellow">target 3</div> </div>
the #target0 entire element (it contains target1 target2 , target3)
you should break out on own:
<div class="main-menu"><a href="#target0" class="panel">main menu link</a> </div> <div id="right" id="main"> <div id="target0" class="panel active">this target menu<br /> <a href="#target1" class="panel">target 1</a><br/> <a href="#target2" class="panel">target 2</a><br/> <a href="#target3" class="panel">target 3</a><br/> </div> <div class="panel" id="target1" style="background:green">target 1</div> <div class="panel" id="target2" style="background:red">target 2</div> <div class="panel" id="target3" style="background:yellow">target 3</div> </div>
edit: make gray block slide, should add panel class (i added active class displays default). you'll need style it
div.panel.active { display:block; }
Comments
Post a Comment