With jquery.slidingTabs you can create unobtrusive carousel-style tabs that load dynamic content via Ajax.
Seu browser não suporta iframes.
First you need to download the jquery and jquery.slidingTabs source. Include them inside the tag <head> of your document:
<script src="javascripts/jquery.1.4.2.js" type="text/javascript" charset="utf-8"></script> <script src="javascripts/jquery.slidingTabs.js" type="text/javascript" charset="utf-8"></script>
Then write some HTML like this:
<div class="multi_tabs"> <div class="menu"> <ul> <li class="active"><a href="ajaxcontent.html">TAB 1</a></li> <li><a href="ajaxcontent.html">TAB 2</a></li> <li><a href="ajaxcontent.html">TAB 3</a></li> <li><a href="ajaxcontent.html">TAB 4</a></li> <li><a href="ajaxcontent.html">TAB 5</a></li> <li><a href="ajaxcontent.html">TAB 6</a></li> <li><a href="ajaxcontent.html">TAB 7</a></li> <li><a href="ajaxcontent.html">TAB 8</a></li> <li><a href="ajaxcontent.html">TAB 9</a></li> <li><a href="ajaxcontent.html">TAB 10</a></li> <li><a href="ajaxcontent.html">TAB 11</a></li> <li><a href="ajaxcontent.html">TAB 12</a></li> <li><a href="ajaxcontent.html">TAB 13</a></li> <li><a href="ajaxcontent.html">TAB 14</a></li> </ul> </div><!-- .menu --> <div class="cont_tabs"> <div> First content </div> </div><!-- cont_tabs --> </div><!-- multitabs -->
…some styles. Note that a few basic styles are required for plugin works.
/*GENERAL STYLES*/ * { margin:0; padding:0; } /*COMMON STYLES FOR TABS*/ .multi_tabs { width:600px; } .multi_tabs .menu { overflow:hidden; position:relative; z-index:10; width:100%; } .multi_tabs ul { overflow:hidden; position:relative; width:9000px; } .multi_tabs ul li{ float:left; display:inline; padding:6px 8px 4px 8px; } .multi_tabs ul li.active{ background:#CCC; } .multi_tabs ul li a{ display:inline; } .multi_tabs ul li.active a{ color:#000; } .multi_tabs .cont_tabs{ clear:both; } .multi_tabs .next, .multi_tabs .prev{ position:absolute; display:block; top:0; width:24px; height:29px; background: #E4E4E4; z-index:100; } .multi_tabs .prev{ left:0; } .multi_tabs .next{ right:0; } .multi_tabs .accessible { display:none; }
And invoke the plugin:
<script type="text/javascript" charset="utf-8"> $(function(){ $('.multi_tabs').slidingTabs({ tabs: '.menu', content : '.cont_tabs' }); }) </script>
Your email is never published nor shared. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
jquery.slidingTabs
animated tabs that load content via Ajax
With jquery.slidingTabs you can create unobtrusive carousel-style tabs that load dynamic content via Ajax.
Examples
Usage
First you need to download the jquery and jquery.slidingTabs source. Include them inside the tag <head> of your document:
Then write some HTML like this:
<div class="multi_tabs"> <div class="menu"> <ul> <li class="active"><a href="ajaxcontent.html">TAB 1</a></li> <li><a href="ajaxcontent.html">TAB 2</a></li> <li><a href="ajaxcontent.html">TAB 3</a></li> <li><a href="ajaxcontent.html">TAB 4</a></li> <li><a href="ajaxcontent.html">TAB 5</a></li> <li><a href="ajaxcontent.html">TAB 6</a></li> <li><a href="ajaxcontent.html">TAB 7</a></li> <li><a href="ajaxcontent.html">TAB 8</a></li> <li><a href="ajaxcontent.html">TAB 9</a></li> <li><a href="ajaxcontent.html">TAB 10</a></li> <li><a href="ajaxcontent.html">TAB 11</a></li> <li><a href="ajaxcontent.html">TAB 12</a></li> <li><a href="ajaxcontent.html">TAB 13</a></li> <li><a href="ajaxcontent.html">TAB 14</a></li> </ul> </div><!-- .menu --> <div class="cont_tabs"> <div> First content </div> </div><!-- cont_tabs --> </div><!-- multitabs -->…some styles. Note that a few basic styles are required for plugin works.
/*GENERAL STYLES*/ * { margin:0; padding:0; } /*COMMON STYLES FOR TABS*/ .multi_tabs { width:600px; } .multi_tabs .menu { overflow:hidden; position:relative; z-index:10; width:100%; } .multi_tabs ul { overflow:hidden; position:relative; width:9000px; } .multi_tabs ul li{ float:left; display:inline; padding:6px 8px 4px 8px; } .multi_tabs ul li.active{ background:#CCC; } .multi_tabs ul li a{ display:inline; } .multi_tabs ul li.active a{ color:#000; } .multi_tabs .cont_tabs{ clear:both; } .multi_tabs .next, .multi_tabs .prev{ position:absolute; display:block; top:0; width:24px; height:29px; background: #E4E4E4; z-index:100; } .multi_tabs .prev{ left:0; } .multi_tabs .next{ right:0; } .multi_tabs .accessible { display:none; }And invoke the plugin:
<script type="text/javascript" charset="utf-8"> $(function(){ $('.multi_tabs').slidingTabs({ tabs: '.menu', content : '.cont_tabs' }); }) </script>Configuration