Team:SJTU-Software2/test
From 2014.igem.org
(Difference between revisions)
Line 17: | Line 17: | ||
</style> | </style> | ||
<script type="text/javascript" src="https://2014.igem.org/Team:SJTU-Software/jm.js%20?action=raw&ctype=text/js"></script> | <script type="text/javascript" src="https://2014.igem.org/Team:SJTU-Software/jm.js%20?action=raw&ctype=text/js"></script> | ||
+ | |||
+ | <style type="text/css"> | ||
+ | .firstHeading { | ||
+ | width: 0px; | ||
+ | height: 0px; | ||
+ | margin: -38px auto; | ||
+ | padding-top: 0px; | ||
+ | margin-bottom: 0px; | ||
+ | font-family: Georgia, Times, "Times New Roman", serif; | ||
+ | } | ||
+ | |||
+ | |||
+ | </style> | ||
+ | <title>Slide Down Box Menu with jQuery and CSS3</title> | ||
+ | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
+ | <meta name="description" content="Slide Down Box Menu with jQuery and CSS3" /> | ||
+ | <meta name="keywords" content="jquery, css3, sliding, box, menu, cube, navigation, portfolio, thumbnails"/> | ||
+ | <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/> | ||
+ | <link rel="stylesheet" href="https://2014.igem.org/Team:SJTU-Software/bootstrapmin.css%20?action=raw&ctype=text/css" type="text/css" media="screen"/> | ||
+ | <style> | ||
+ | body{ | ||
+ | background:#333 url(https://static.igem.org/mediawiki/2014/d/da/Han_bg.jpg) repeat top left ; | ||
+ | font-family:Arial; | ||
+ | } | ||
+ | span.reference{ | ||
+ | position:fixed; | ||
+ | left:10px; | ||
+ | bottom:10px; | ||
+ | font-size:12px; | ||
+ | } | ||
+ | span.reference a{ | ||
+ | color:#aaa; | ||
+ | text-transform:uppercase; | ||
+ | text-decoration:none; | ||
+ | text-shadow:1px 1px 1px #000; | ||
+ | margin-right:30px; | ||
+ | } | ||
+ | span.reference a:hover{ | ||
+ | color:#ddd; | ||
+ | } | ||
+ | ul.sdt_menu{ | ||
+ | margin-top:0px; | ||
+ | |||
+ | } | ||
+ | h1.title{ | ||
+ | text-indent:-9000px; | ||
+ | background:transparent url(title.png) no-repeat top left; | ||
+ | width:633px; | ||
+ | height:69px; | ||
+ | } | ||
+ | </style> | ||
+ | </p> | ||
+ | |||
+ | <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script> | ||
+ | <script src="http://cdn.bootcss.com/twitter-bootstrap/3.0.2/js/bootstrap.min.js"></script> | ||
+ | <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.2/css/bootstrap.min.css"> | ||
+ | |||
+ | |||
+ | <!--<body style="background-image:url(https://static.igem.org/mediawiki/2014/6/67/Background2.jpg);background-position:center; background-repeat:repeat-y repeat-x">--> | ||
+ | |||
+ | |||
+ | <table width="70%" align="center"> | ||
+ | |||
+ | |||
+ | |||
+ | <!--navigation menu --> | ||
+ | |||
+ | |||
+ | <div class="content" align="center"> | ||
+ | |||
+ | <img src="https://static.igem.org/mediawiki/2014/7/79/Han_without.jpg"; height=100px; width=1020px> | ||
+ | |||
+ | </div> | ||
+ | |||
+ | <div class="content" align="center"> | ||
+ | |||
+ | <ul id="sdt_menu" class="sdt_menu"> | ||
+ | <li> | ||
+ | <a href="#"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/b/bd/Test.jpg" alt=""/> | ||
+ | <span class="sdt_active"></span> | ||
+ | <span class="sdt_wrap"> | ||
+ | <span class="sdt_link">Home</span> | ||
+ | <span class="sdt_descr">Get to Our Project</span> | ||
+ | </span> | ||
+ | </a> | ||
+ | </li> | ||
+ | <li> | ||
+ | <a href="#"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/b/bd/Test.jpg" alt=""/> | ||
+ | <span class="sdt_active"></span> | ||
+ | <span class="sdt_wrap"> | ||
+ | <span class="sdt_link">Software</span> | ||
+ | <span class="sdt_descr">Our work</span> | ||
+ | </span> | ||
+ | </a> | ||
+ | <div class="sdt_box"> | ||
+ | <a href="#">Search</a> | ||
+ | <a href="#">Design</a> | ||
+ | <a href="#">Upload</a> | ||
+ | </div> | ||
+ | </li> | ||
+ | <li> | ||
+ | <a href="#"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/b/bd/Test.jpg" alt=""/> | ||
+ | <span class="sdt_active"></span> | ||
+ | <span class="sdt_wrap"> | ||
+ | <span class="sdt_link">Team</span> | ||
+ | <span class="sdt_descr">Our strong team</span> | ||
+ | </span> | ||
+ | </a> | ||
+ | </li> | ||
+ | <li> | ||
+ | <a href="#"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/b/bd/Test.jpg" alt=""/> | ||
+ | <span class="sdt_active"></span> | ||
+ | <span class="sdt_wrap"> | ||
+ | <span class="sdt_link">Document</span> | ||
+ | <span class="sdt_descr">Some Introduction</span> | ||
+ | </span> | ||
+ | </a> | ||
+ | </li> | ||
+ | <li> | ||
+ | <a href="#"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/b/bd/Test.jpg" alt=""/> | ||
+ | <span class="sdt_active"></span> | ||
+ | <span class="sdt_wrap"> | ||
+ | <span class="sdt_link">Requirement</span> | ||
+ | <span class="sdt_descr">Some Requirement</span> | ||
+ | </span> | ||
+ | </a> | ||
+ | </li> | ||
+ | <li> | ||
+ | <a href="#"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/b/bd/Test.jpg" alt=""/> | ||
+ | <span class="sdt_active"></span> | ||
+ | <span class="sdt_wrap"> | ||
+ | <span class="sdt_link">Human Practice</span> | ||
+ | <span class="sdt_descr">I like Hp</span> | ||
+ | </span> | ||
+ | </a> | ||
+ | <div class="sdt_box"> | ||
+ | <a href="#">aaaaaaaaa</a> | ||
+ | <a href="#">bbbbbbbbb</a> | ||
+ | <a href="#">ccccccccc</a> | ||
+ | </div> | ||
+ | </li> | ||
+ | </ul> | ||
+ | </div> | ||
+ | |||
+ | |||
<div class="container"> | <div class="container"> | ||
<ul id="myRoundabout"> | <ul id="myRoundabout"> | ||
Line 30: | Line 181: | ||
<script type="text/javascript" src="https://2014.igem.org/Team:SJTU-Software/gi.js%20?action=raw&ctype=text/js"></script> | <script type="text/javascript" src="https://2014.igem.org/Team:SJTU-Software/gi.js%20?action=raw&ctype=text/js"></script> | ||
<script type="text/javascript"> Cufon.now(); </script> | <script type="text/javascript"> Cufon.now(); </script> | ||
- | |||
- | + | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
+ | <script type="text/javascript" src="https://2014.igem.org/Team:SJTU-Software/jquery.js%20?action=raw&ctype=text/js"></script> | ||
+ | <script type="text/javascript"> | ||
+ | $(function() { | ||
+ | /** | ||
+ | * for each menu element, on mouseenter, | ||
+ | * we enlarge the image, and show both sdt_active span and | ||
+ | * sdt_wrap span. If the element has a sub menu (sdt_box), | ||
+ | * then we slide it - if the element is the last one in the menu | ||
+ | * we slide it to the left, otherwise to the right | ||
+ | */ | ||
+ | $('#sdt_menu > li').bind('mouseenter',function(){ | ||
+ | var $elem = $(this); | ||
+ | $elem.find('img') | ||
+ | .stop(true) | ||
+ | .animate({ | ||
+ | 'width':'170px', | ||
+ | 'height':'170px', | ||
+ | 'left':'0px' | ||
+ | },400,'easeOutBack') | ||
+ | .andSelf() | ||
+ | .find('.sdt_wrap') | ||
+ | .stop(true) | ||
+ | .animate({'top':'140px'},500,'easeOutBack') | ||
+ | .andSelf() | ||
+ | .find('.sdt_active') | ||
+ | .stop(true) | ||
+ | .animate({'height':'170px'},300,function(){ | ||
+ | var $sub_menu = $elem.find('.sdt_box'); | ||
+ | if($sub_menu.length){ | ||
+ | var left = '170px'; | ||
+ | if($elem.parent().children().length == $elem.index()+1) | ||
+ | left = '-170px'; | ||
+ | $sub_menu.show().animate({'left':left},200); | ||
+ | } | ||
+ | }); | ||
+ | }).bind('mouseleave',function(){ | ||
+ | var $elem = $(this); | ||
+ | var $sub_menu = $elem.find('.sdt_box'); | ||
+ | if($sub_menu.length) | ||
+ | $sub_menu.hide().css('left','0px'); | ||
+ | |||
+ | $elem.find('.sdt_active') | ||
+ | .stop(true) | ||
+ | .animate({'height':'0px'},300) | ||
+ | .andSelf().find('img') | ||
+ | .stop(true) | ||
+ | .animate({ | ||
+ | 'width':'0px', | ||
+ | 'height':'0px', | ||
+ | 'left':'85px'},400) | ||
+ | .andSelf() | ||
+ | .find('.sdt_wrap') | ||
+ | .stop(true) | ||
+ | .animate({'top':'25px'},500); | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | |||
</table> | </table> |
Revision as of 10:25, 3 October 2014