Team:Shenzhen BGIC 0101/Tutorial
From 2013.igem.org
(Created page with "<html> <head> <!-- iGem wiki hacks --> <!-- Remove all empty <p> tags --> <script type="text/javascript"> $(document).ready(function() { ...") |
|||
Line 44: | Line 44: | ||
<script type="text/javascript" src="//use.typekit.net/jlr8wlp.js"></script> | <script type="text/javascript" src="//use.typekit.net/jlr8wlp.js"></script> | ||
<script type="text/javascript">try{Typekit.load();}catch(e){}</script> | <script type="text/javascript">try{Typekit.load();}catch(e){}</script> | ||
+ | |||
+ | <style> | ||
+ | |||
+ | #tabs { | ||
+ | overflow: hidden; | ||
+ | width: 100%; | ||
+ | margin: 0; | ||
+ | margin-left: 25%; | ||
+ | padding: 0; | ||
+ | list-style: none; | ||
+ | font-size: 1.3em; | ||
+ | |||
+ | font-weight: 800; | ||
+ | } | ||
+ | |||
+ | #tabs li { | ||
+ | float: left; | ||
+ | margin: 0 -15px 0 0; | ||
+ | } | ||
+ | |||
+ | #tabs a { | ||
+ | float: left; | ||
+ | position: relative; | ||
+ | padding: 0 40px; | ||
+ | height: 0; | ||
+ | line-height: 30px; | ||
+ | text-transform: uppercase; | ||
+ | text-decoration: none; | ||
+ | color: #38f; | ||
+ | border-right: 30px solid transparent; | ||
+ | border-bottom: 30px solid rgba(54, 49, 49, 0.71); | ||
+ | border-bottom-color: #777\9; | ||
+ | // opacity: .3; | ||
+ | filter: alpha(opacity=30); | ||
+ | } | ||
+ | |||
+ | #tabs a:hover, | ||
+ | #tabs a:focus { | ||
+ | border-bottom-color: #2ac7e1; | ||
+ | opacity: 1; | ||
+ | filter: alpha(opacity=100); | ||
+ | } | ||
+ | |||
+ | #tabs a:focus { | ||
+ | outline: 0; | ||
+ | } | ||
+ | |||
+ | #tabs #current { | ||
+ | z-index: 3; | ||
+ | border-bottom-color: #3d3d3d; | ||
+ | opacity: 1; | ||
+ | filter: alpha(opacity=100); | ||
+ | font-size: 16px; | ||
+ | line-height: 19px; | ||
+ | font-family: Trebuchet MS; | ||
+ | font-weight: 600; | ||
+ | } | ||
+ | #tab1,#tab2,#tab3,#tab4{ | ||
+ | font-size: 16px; | ||
+ | line-height: 19px; | ||
+ | font-family: Trebuchet MS; | ||
+ | font-weight: 600; | ||
+ | color: #ccc; | ||
+ | } | ||
+ | /* ----------- */ | ||
+ | #content2 { | ||
+ | background: rgba(29, 28, 28, 0.79); | ||
+ | border-top: 2px solid #3d3d3d; | ||
+ | padding: 2em; | ||
+ | width :55%; | ||
+ | margin-left: 25%; | ||
+ | |||
+ | } | ||
+ | |||
+ | #content2 h2, | ||
+ | #content h3, | ||
+ | #content p { | ||
+ | margin: 0 0 15px 0; | ||
+ | |||
+ | } | ||
+ | |||
+ | </style> | ||
+ | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function FloatMenu(){ | function FloatMenu(){ | ||
Line 125: | Line 208: | ||
</div> | </div> | ||
<br/> | <br/> | ||
- | <a name=" | + | <h2 style="font-family: 'Tangerine', serif;font-size: 48px; text-shadow: 4px 4px 4px #aaa; color: #38f; |
- | < | + | letter-spacing: 0.1em; |
- | + | word-spacing: 0.3em; | |
- | + | font-weight: 700; | |
- | + | line-height: 36px; | |
- | + | margin: 0; | |
- | + | margin-left: 20%;">Tutorial</h2><br/> | |
- | + | <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="content2"> | ||
+ | <div id="tab1"> | ||
+ | <h2>Lorem ipsum sit amet</h2> | ||
+ | <p>Praesent risus nisi, iaculis nec condimentum vel, rhoncus vel dolor. Aenean nisi lectus, varius nec tempus id, dapibus non quam.</p> | ||
+ | <p>Suspendisse ac libero mauris. Cras lacinia porttitor urna, vitae molestie libero posuere et. Mauris turpis tortor, mollis non vulputate sit amet, rhoncus vitae purus.</p> | ||
+ | <h3>Pellentesque habitant</h3> | ||
+ | <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.</p> | ||
+ | </div> | ||
+ | <div id="tab2"> | ||
+ | <h2>Vivamus fringilla suscipit justo</h2> | ||
+ | <p>Aenean dui nulla, egestas sit amet auctor vitae, facilisis id odio. Donec dictum gravida feugiat.</p> | ||
+ | <p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras pretium elit et erat condimentum et volutpat lorem vehicula</p> | ||
- | <p> | + | <p>Morbi tincidunt pharetra orci commodo molestie. Praesent ut leo nec dolor tempor eleifend.</p> |
+ | </div> | ||
+ | <div id="tab3"> | ||
+ | <h2>Phasellus non nibh</h2> | ||
+ | <p>Non erat laoreet ullamcorper. Pellentesque magna metus, feugiat eu elementum sit amet, cursus sed diam. Curabitur posuere porttitor lorem, eu malesuada tortor faucibus sed.</p> | ||
+ | <h3>Duis pulvinar nibh vel urna</h3> | ||
+ | <p>Donec purus leo, porttitor eu molestie quis, porttitor sit amet ipsum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec accumsan ornare elit id imperdiet. </p> | ||
+ | <p>Suspendisse ac libero mauris. Cras lacinia porttitor urna, vitae molestie libero posuere et. </p> | ||
+ | </div> | ||
+ | <div id="tab4"> | ||
+ | <h2>Cum sociis natoque penatibus</h2> | ||
+ | <p>Magnis dis parturient montes, nascetur ridiculus mus. Nullam ac massa quis nisi porta mollis venenatis sit amet urna. Ut in mauris velit, sed bibendum turpis.</p> | ||
+ | <p>Nam ornare vulputate risus, id volutpat elit porttitor non. In consequat nisi vel lectus dapibus sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent bibendum sagittis libero.</p> | ||
+ | <h3>Imperdiet sem interdum nec</h3> | ||
+ | <p>Mauris rhoncus tincidunt libero quis fringilla.</p> | ||
+ | </div> | ||
+ | </div> | ||
- | < | + | <script> |
- | + | function resetTabs(){ | |
- | + | $("#content2 > div").hide(); //Hide all content | |
- | + | $("#tabs a").attr("id",""); //Reset id's | |
- | + | } | |
- | </ | + | |
- | + | var myUrl = window.location.href; //get URL | |
- | </ | + | var myUrlTab = myUrl.substring(myUrl.indexOf("#")); // For localhost/tabs.html#tab2, myUrlTab = #tab2 |
+ | var myUrlTabName = myUrlTab.substring(0,4); // For the above example, myUrlTabName = #tab | ||
+ | |||
+ | (function(){ | ||
+ | $("#content2 > div").hide(); // Initially hide all content | ||
+ | $("#tabs li:first a").attr("id","current"); // Activate first tab | ||
+ | $("#content2 > div:first").fadeIn(); // Show first tab content | ||
+ | |||
+ | $("#tabs a").on("click",function(e) { | ||
+ | e.preventDefault(); | ||
+ | if ($(this).attr("id") == "current"){ //detection for current tab | ||
+ | return | ||
+ | } | ||
+ | else{ | ||
+ | resetTabs(); | ||
+ | $(this).attr("id","current"); // Activate this | ||
+ | $($(this).attr('name')).fadeIn(); // Show content for current tab | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | for (i = 1; i <= $("#tabs li").length; i++) { | ||
+ | if (myUrlTab == myUrlTabName + i) { | ||
+ | resetTabs(); | ||
+ | $("a[name='"+myUrlTab+"']").attr("id","current"); // Activate url tab | ||
+ | $(myUrlTab).fadeIn(); // Show url tab content | ||
+ | } | ||
+ | } | ||
+ | })() | ||
+ | </script> | ||
+ | <br/><br/><br/><br/> | ||
<div class="push"></div> | <div class="push"></div> | ||
</div><!-- wrapper --> | </div><!-- wrapper --> |
Revision as of 09:17, 27 September 2013
Tutorial
Lorem ipsum sit amet
Praesent risus nisi, iaculis nec condimentum vel, rhoncus vel dolor. Aenean nisi lectus, varius nec tempus id, dapibus non quam.
Suspendisse ac libero mauris. Cras lacinia porttitor urna, vitae molestie libero posuere et. Mauris turpis tortor, mollis non vulputate sit amet, rhoncus vitae purus.
Pellentesque habitant
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Vivamus fringilla suscipit justo
Aenean dui nulla, egestas sit amet auctor vitae, facilisis id odio. Donec dictum gravida feugiat.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras pretium elit et erat condimentum et volutpat lorem vehicula
Morbi tincidunt pharetra orci commodo molestie. Praesent ut leo nec dolor tempor eleifend.
Phasellus non nibh
Non erat laoreet ullamcorper. Pellentesque magna metus, feugiat eu elementum sit amet, cursus sed diam. Curabitur posuere porttitor lorem, eu malesuada tortor faucibus sed.
Duis pulvinar nibh vel urna
Donec purus leo, porttitor eu molestie quis, porttitor sit amet ipsum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec accumsan ornare elit id imperdiet.
Suspendisse ac libero mauris. Cras lacinia porttitor urna, vitae molestie libero posuere et.
Cum sociis natoque penatibus
Magnis dis parturient montes, nascetur ridiculus mus. Nullam ac massa quis nisi porta mollis venenatis sit amet urna. Ut in mauris velit, sed bibendum turpis.
Nam ornare vulputate risus, id volutpat elit porttitor non. In consequat nisi vel lectus dapibus sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent bibendum sagittis libero.
Imperdiet sem interdum nec
Mauris rhoncus tincidunt libero quis fringilla.