How to reset first position before using animate left
Hi, i'm really new for jquery, i search over the internet about jquery, and start to learn.
My problem maybe seems silly, I want to make 3 panel that functionally like we browse files in mac. I already suceed made 2 panel, the problem is, at the first load, the second panel already shown. I want it keep hide, until people clicked the button.
This what i have, (please click the home text)
This the complete script
- <html>
- <head>
- <style type="text/css" media="screen">
- html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary,time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
- }
- .container {
- width: 100%;
- }
- .menu_panel {
- width: 15%;
- float: left;
- background-color: #aaa;
- height: 1000px;
- }
- .content_panel {
- width: 50%;
- float:left;
- background-color: #DEA140;
- height: 1000px;
- position: relative;
- left:0;
- z-index: -1;
- }
- .hidden {
- display: none;
- }
- </style>
- <script src="jquery-1.5.min.js" type="text/javascript"></script>
- </head>
- <body>
- <div class="container">
- <div class="menu_panel">
- <ul>
- <li class="menu_head">Home</li>
- <ul class="menu_body">
- <li>Feature Slider</li>
- <li>Audio</li>
- <li>Feature Album</li>
- <li>Social Network Link</li>
- </ul>
- <li class="menu_head">Home</li>
- <ul class="menu_body">
- <li>Feature Slider</li>
- <li>Audio</li>
- <li>Feature Album</li>
- <li>Social Network Link</li>
- </ul>
- </ul>
- </div>
- <div class="content_panel" id="slide">
- <iframe src="content_panel.htm" width="100%" height="100%">
- </iframe>
- </div>
- </div>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".menu_body").hide();
- $(".menu_head").click(function() {
- $(this).next(".menu_body").slideToggle(600);
- });
- $('.menu_body li').click(function() {
- var $lefty = $('#slide');
- $lefty.animate({
- left: parseInt($lefty.css('left'),10) == 0 ?
- -$lefty.outerWidth() :
- 0
- });
- });
- });
- </script>
- </body>
- </html>
Can anybody help me?