Team:Hong Kong-CUHK/project.html

From 2014.igem.org

(Difference between revisions)
m
m
Line 23: Line 23:
     height: 200px;
     height: 200px;
}
}
-
.projectAEntry{
+
#projectAEntry{
background-image: url('https://static.igem.org/mediawiki/2014/thumb/6/65/ABCDE_system_button.png/600px-ABCDE_system_button.png');
background-image: url('https://static.igem.org/mediawiki/2014/thumb/6/65/ABCDE_system_button.png/600px-ABCDE_system_button.png');
 +
background-size: contain;
height: 400px;
height: 400px;
}
}
-
.projectAEntry:hover {
+
#projectAEntry:hover {
background-image: url('https://static.igem.org/mediawiki/2014/thumb/1/10/ABCDE_system_button2.png/600px-ABCDE_system_button2.png');
background-image: url('https://static.igem.org/mediawiki/2014/thumb/1/10/ABCDE_system_button2.png/600px-ABCDE_system_button2.png');
 +
}
 +
#projectBEntry{
 +
background-image: url('https://static.igem.org/mediawiki/2014/thumb/9/99/ABCDE_button.png/600px-ABCDE_button.png');
 +
background-size: contain;
height: 400px;
height: 400px;
}
}
-
.projectBEntry:hover {
+
#projectBEntry:hover {
background-image: url('https://static.igem.org/mediawiki/2014/thumb/3/3d/ABCDE_button2.png/600px-ABCDE_button2.png');
background-image: url('https://static.igem.org/mediawiki/2014/thumb/3/3d/ABCDE_button2.png/600px-ABCDE_button2.png');
-
height: 400px;
 
}
}
</style>
</style>
Line 39: Line 43:
<div id="projectChoice" class="container">
<div id="projectChoice" class="container">
     <div class="row row-centered">
     <div class="row row-centered">
-
         <a id="projectAEntry" class="col-xs-6 col-centered" href="#">
+
         <a id="projectAEntry" class="col-xs-6 col-centered" href="#" />
-
            <img src="https://static.igem.org/mediawiki/2014/thumb/6/65/ABCDE_system_button.png/600px-ABCDE_system_button.png" height="400px">
+
         <a id="projectBEntry" class="col-xs-6 col-centered" href="#" />
-
         </a>
+
-
<a id="projectBEntry" class="col-xs-6 col-centered" href="#">
+
-
            <img src="https://static.igem.org/mediawiki/2014/thumb/9/99/ABCDE_button.png/600px-ABCDE_button.png" height="400px">
+
-
        </a>
+
     </div>
     </div>
</div>
</div>

Revision as of 18:10, 22 November 2014

<style type="text/css"> /* Next Button */

  1. btn-next {
   position: fixed;
   right: 10px;
   bottom: 50px;
   z-index: 999;

}

  1. btn-next a {
   background-image: url('https://static.igem.org/mediawiki/2014/1/1e/Btn-Next.png');
   background-size: contain;
   background-repeat: no-repeat;
   background-position: center bottom;
   margin-bottom: -40px;
   width: 50px;
   height: 50px;
   display: block;

}

  1. btn-next a:hover {
   background-image: url('https://static.igem.org/mediawiki/2014/1/1e/Btn-Next.png');
   width: 119px;
   height: 200px;

}

  1. projectAEntry{

background-image: url('https://static.igem.org/mediawiki/2014/thumb/6/65/ABCDE_system_button.png/600px-ABCDE_system_button.png'); background-size: contain; height: 400px; }

  1. projectAEntry:hover {

background-image: url('https://static.igem.org/mediawiki/2014/thumb/1/10/ABCDE_system_button2.png/600px-ABCDE_system_button2.png'); }

  1. projectBEntry{

background-image: url('https://static.igem.org/mediawiki/2014/thumb/9/99/ABCDE_button.png/600px-ABCDE_button.png'); background-size: contain; height: 400px; }

  1. projectBEntry:hover {

background-image: url('https://static.igem.org/mediawiki/2014/thumb/3/3d/ABCDE_button2.png/600px-ABCDE_button2.png'); } </style>

       <a id="projectAEntry" class="col-xs-6 col-centered" href="#" />
       <a id="projectBEntry" class="col-xs-6 col-centered" href="#" />

<script type="text/javascript"> var projectAContent = [{

   "content": "projectA-background.html?action=raw&ctype=text/html"

}, {

   "content": "projectA-biobricks.html?action=raw&ctype=text/html"

}, {

   "content": "modelling.html?action=raw&ctype=text/html"

}, {

   "content": "projectA-result.html?action=raw&ctype=text/html"

}];

var projectBContent = [{

   "content": "project-1.html?action=raw&ctype=text/html"

}, {

   "content": "project-2.html?action=raw&ctype=text/html"

}, {

   "content": "project-3.html?action=raw&ctype=text/html"

}, {

   "content": "project-4.html?action=raw&ctype=text/html"

}, {

   "content": "project-5.html?action=raw&ctype=text/html"

}];

function loadContent(projectContent) { var deferreds = []; $.each(projectContent, function(index, value) {

   deferreds.push(
       $.get(value['content'], function(data) {
           value['loadedContent'] = data;
       })
   );

});

$.when.apply(null, deferreds).done(function() {

   projectCurrentPageIndex = 0;
   $('#project-content').html(projectContent[projectCurrentPageIndex]['loadedContent']);
   $('#btn-next').click(function() {
       if (projectCurrentPageIndex + 1 < projectContent.length) {
           projectCurrentPageIndex++;
           $('#project-content').html(projectContent[projectCurrentPageIndex]['loadedContent']);
       }
   });

}); }

$('#projectAEntry').click(function(e){

   console.log('A');
   $('#projectChoice').hide();
   $('#btn-next').show();
   loadContent(projectAContent);

});

$('#projectBEntry').click(function(e){

   console.log('B');
   $('#projectChoice').hide();
   $('#btn-next').show();
   loadContent(projectBContent);

}); </script>