Presto-X Posted January 10, 2012 Share Posted January 10, 2012 Hello everyone, I'm new to jQuery and I'm guessing this is really easy but I cannot get it to work, I have a set of tabbed panels, and I want the content divs when a tab is clicked to slide down and the new content div to slide up. My tabs are at the bottom of the content. <link type="text/css" href="jquery/css/smoothness/jquery-ui-1.8.16.custom.css" rel="stylesheet" /> <script type="text/javascript" src="jquery/js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="jquery/js/jquery-ui-1.8.16.custom.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#tabbedPanel1').tabs(); $( ".tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *" ) .removeClass( "ui-corner-all ui-corner-top" ) .addClass( "ui-corner-bottom" ); }); </script> <style> #tabs { height: 200px; } .tabs-bottom { position: relative; } .tabs-bottom .ui-tabs-panel { height: 140px; overflow: auto; } .tabs-bottom .ui-tabs-nav { position: absolute !important; left: 0; bottom: 0; right:0; padding: 0 0.2em 0.2em 0; } .tabs-bottom .ui-tabs-nav li { margin-top: -2px !important; margin-bottom: 1px !important; border-top: none; border-bottom-width: 1px; } .ui-tabs-selected { margin-top: -3px !important; } </style> <div id="tabbedPanel1" class="tabs-bottom"> <ul class="tabs"> <li><a href="#tab1">First</a></li> <li><a href="#tab2">Second</a></li> <li><a href="#tab3">Third</a></li> </ul> <div class="contentWrapper"> <div id="tab1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> <div id="tab2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div> <div id="tab3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div> </div> </div> Quote Link to comment https://forums.phpfreaks.com/topic/254749-tabbed-panel-slide-content-out-then-back-in/ Share on other sites More sharing options...
shaiang Posted January 15, 2012 Share Posted January 15, 2012 If I understand correctly . try the jquery UI plugin accordion http://jqueryui.com/demos/accordion/ Quote Link to comment https://forums.phpfreaks.com/topic/254749-tabbed-panel-slide-content-out-then-back-in/#findComment-1307877 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.