Trouble with jquery accordion width, scaling, and alignment -
i want accordion stretch width of webpage , tabs able stack on top of each other without space in between. have use images tabs.
this how homepage should when tabs/buttons closed: i.imgur.com/ajmdepq.png
when they're closed in actual webpage, don't stretch way edges , don't touch
this 1 of accordion tabs looks like: http://i.imgur.com/npzckzp.png
html:
<!doctype html> <head> <link href="style.css" rel="stylesheet" type="text/css"/> <title>jennifer wexler's portfolio site</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").slidetoggle(); }); }); </script> <link rel="stylesheet" type="text/css" href="stylesheet.css"/> <script type="text/javascript" src="script.js"></script> </head> <body> <div id="container"> <div id="logo"> <center><img src="images/logo.png"></center> </div> <div id="nav"> <ul> <li><a class="nav", href="index_homepage.html">work</a></li> <li><a class="nav", href="http://www.google.com">resume</a></li> <li><a class="nav", href="http://www.google.com">contact</a></li> </ul> </div> <!--the code player practice. issues being width of site, hover state still working.--> <div id="accordian"> <ul> <li> <img class="fs_button", src="images/fashion_spread.jpg" onmouseover="this.src='images/fashion_spread_hover.jpg'" onmouseout="this.src='images/fashion_spread.jpg'"> <ul> <li><img class="fashionspread", src="images/fs_1.jpg"></li> <li><p> surreal fashion spread taking place in front of theatre 1940s. tells story of girl longing in limelight. original photography, styling, , experimental typography.</p></li> </ul> </li> </ul> </div> </div> </div> </body> </html> css:
html { font-family:didot; margin:0px; padding:0px; background:#fdf9f0; } body { margin-left:auto; margin-right:auto; } #container { margin-left:auto; margin-right:auto; width:100%; } #logo { margin-left:auto; margin-right:auto; width:100%; } #nav { margin-left:auto; margin-right:auto; top:0px; width:50%; font-family:didot; font-size:15px; } #nav ul { list-style-type: none; text-align: center; padding-top:145px; padding-bottom:145px; } #nav ul li { display: inline; padding-left:30px; padding-right:30px; } .nav: hover { border-color:#000; border-width:thin; } .nav:link { color:#000000; text-decoration:none; padding-top:5px; padding-bottom:5px; padding-left:6px; padding-right:6px; } .nav:visited { color:#000000; text-decoration:none; padding-top:5px; padding-bottom:5px; padding-left:6px; padding-right:6px; } .nav:hover { color:#98b7a8; text-decoration:none; border-color:#000000; border-width:1px; border-style:solid; padding-top:5px; padding-bottom:5px; padding-left:5px; padding-right:5px; } .nav:active {color:#000000;} #work { margin-left:0px; margin-right:0px; width:100%; } .work { margin-left:0px; margin-right:0px; width:100%; height:auto; display:block; } /*the code player practice*/ #accordian { width: 100%; padding: none; alignment-adjust:central; } /*list items*/ #accordian li { list-style-type: none; } /*links*/ #accordian ul ul li { display: block; /*transition smooth hover animation*/ transition: 0.15s; } /*lets hide non active lis default*/ #accordian ul ul { display: none; width: auto; } #accordian li.active ul { display: block; } jquery:
/*jquery time*/ $(document).ready(function(){ $(".fs_button").click(function(){ //slide link lists $("#accordian ul ul").slideup(); //slide down link list below h3 clicked - if closed if(!$(this).next().is(":visible")) { $(this).next().slidedown(); } }) }) thanks!
Comments
Post a Comment