hsilva Posted August 3, 2012 at 11:57 AM Report Share #471372 Posted August 3, 2012 at 11:57 AM bom dia estou construir uma pagina com multi tabs. mas na estou conseguir por funcionar a tab que esta dentro da outra tab... esta aqui o codigo: <script type="text/javascript" src="code.jquery.com/jquery-1.7.2.min.js%22%3E%3C/script%3E"></script> <script type="text/javascript"> $(document).ready(function () { $("#content div").hide(); // Initially hide all content $("#content_2 div").hide(); // Initially hide all content $("#tabs li:first").attr("id", "current"); // Activate first tab $("#tabs_2 li:first").attr("id", "current"); // Activate first tab $("#content div:first").fadeIn(); // Show first tab content $("#content_2 div:first").fadeIn(); // Show first tab content $('#tabs a').click(function (e) { e.preventDefault(); if ($(this).closest("li").attr("id") == "current") { //detection for current tab return } else { $("#content div").hide(); //Hide all content $("#content_2 div").hide(); //Hide all content $("#tabs li").attr("id", ""); //Reset id's $("#tabs_2 li").attr("id", ""); //Reset id's $(this).parent().attr("id", "current"); // Activate this $('#' + $(this).attr('name')).fadeIn(); // Show content for current tab } }); }); </script> <ul id="tabs"> <li><a href="#" name="tab1">One</a></li> <li><a href="#" name="tab2">Two</a></li> <li><a href="#" name="tab3">Three</a></li> <li><a href="#" name="tab4">Four</a></li> </ul> <div id="content"> <div id="tab1"> <ul id="tabs_2"> <li><a href="#" name="tab5">1</a></li> <li><a href="#" name="tab6">2</a></li> <li><a href="#" name="tab7">3</a></li> <li><a href="#" name="tab8">4</a></li> </ul> <div id="content_2"> <div id="tab5"> </div> <div id="tab6">...</div> <div id="tabe7">...</div> </div> </div> <div id="tab2"> </div> <div id="tab3"> </div> <div id="tab4"> </div> </div> Link to comment Share on other sites More sharing options...
brunoais Posted August 5, 2012 at 03:58 PM Report Share #471541 Posted August 5, 2012 at 03:58 PM Ok. E? É preciso informação! Se não indicas informação bem podes esquecer a ajuda porque não há ajuda possível. Bruxos? aqui não há! "[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31 Life is a genetically transmitted disease, induced by sex, with death rate of 100%. Link to comment Share on other sites More sharing options...
yoda Posted August 8, 2012 at 05:21 PM Report Share #471764 Posted August 8, 2012 at 05:21 PM Usa o jQuery UI Tabs, parece-me indicado. before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
Octàvio Luzio Posted August 10, 2012 at 05:03 PM Report Share #471972 Posted August 10, 2012 at 05:03 PM (edited) tens aqui um tab simples e fazte explicar melhor qual o problema sff <script> $(function() { $( "#tabs" ).tabs(); }); </script> <div class="tab-container"> <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris.</p> </div> <div id="tabs-2"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris.</p> </div> <div id="tabs-3"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris.</p> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris.</p> </div> </div> </div> Edited August 10, 2012 at 10:32 PM by Octàvio Luzio Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted August 10, 2012 at 05:08 PM Report Share #471974 Posted August 10, 2012 at 05:08 PM tens aqui um tab simples e fazte explicar melhor qual o problema sff tens a noção do que acabaste de apresentar ??? achas que isso funciona corretamente ??? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Octàvio Luzio Posted August 10, 2012 at 11:04 PM Report Share #472003 Posted August 10, 2012 at 11:04 PM (edited) tens a noção do que acabaste de apresentar ??? achas que isso funciona corretamente ??? Boas... Tabs são geralmente usados para quebrar o conteúdo em várias seções que podem ser trocados para economizar espaço ou seja mostra ou esconde (SHOW HIDE) conteudos. sim o codico esta correto...mas imcompleto certo... para completares procura aqui o que te falta para fazer as funço~es que realmente se adptão ao quer que seja. Veja aqui: http://jqueryui.com/demos/tabs/ Espero que esteja certo!!! Abraço Edited August 10, 2012 at 11:07 PM by Octàvio Luzio Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted August 10, 2012 at 11:13 PM Report Share #472006 Posted August 10, 2012 at 11:13 PM eu sei perfeitamente o que tabs .. e se o @hsilva perguntou é porque também sabe agora, o problema é que se o @hsilva pegar no teu código e espeta-lo numa página ele, não irá funcionar porque não deste informação suficiente para que ele o conseguisse fazer. logo por muito que te pareça correto, está realmente errado. da próxima tens de dizer à partida que o exemplo dado usa o jQuery UI IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now