Team:Virginia/Notebook
From 2014.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
<html> | <html> | ||
<head> | <head> | ||
- | + | <script src="//code.jquery.com/jquery-2.1.0.min.js"></script> | |
<style> | <style> | ||
/* ---------- Based upon 'reset.css' in the Yahoo! User Interface Library: http://developer.yahoo.com/yui ---------- */ | /* ---------- Based upon 'reset.css' in the Yahoo! User Interface Library: http://developer.yahoo.com/yui ---------- */ | ||
Line 119: | Line 119: | ||
</div> <!-- end tabs --> | </div> <!-- end tabs --> | ||
+ | |||
+ | <script> | ||
+ | $(document).ready(function() { | ||
+ | |||
+ | var $tabs = $('#tabs div'); | ||
+ | $tabs.hide(); | ||
+ | var index = Math.floor($tabs.length * Math.random()); | ||
+ | $tabs.eq(index).show(); | ||
+ | $('#tabs ul li').eq(index).addClass('active'); | ||
+ | $('#tabs ul li a').click(function() { //When any link is clicked | ||
+ | $('#tabs ul li').removeClass('active'); // Remove active class from all links | ||
+ | $(this).parent().addClass('active'); //Set clicked link class to active | ||
+ | var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link | ||
+ | $('#tabs div').hide(); // Hide all divs | ||
+ | $(currentTab).show(); // Show div with id equal to variable currentTab | ||
+ | return false; | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 18:17, 4 August 2014
Tab 1
Some content
Tab 2
Some content
Tab 3
Some content
Tab 4
Some content