Team:Hong Kong-CUHK/project.html

From 2014.igem.org

(Difference between revisions)
(Created page with "<style type="text/css"> - Next Button: #btn-next { position: fixed; right: 10px; bottom: 50px; z-index: 999; } #btn-next a { background-image: url('http:/...")
(proj page name updated)
Line 32: Line 32:
<script type="text/javascript">
<script type="text/javascript">
var projectContent = [{
var projectContent = [{
-
     "content": "project-abstract.html"
+
     "content": "project-1.html"
}, {
}, {
-
     "content": "project-overview.html"
+
     "content": "project-2.html"
}, {
}, {
-
     "content": "project-voltage-switch.html"
+
     "content": "project-3.html"
}, {
}, {
-
     "content": "project-pah-degradation.html"
+
     "content": "project-4.html"
}, {
}, {
-
     "content": "project-results.html"
+
     "content": "project-5.html"
}, {
}, {
-
     "content": "project-future-application.html"
+
     "content": "project-6.html"
}];
}];

Revision as of 17:55, 16 October 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/a/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;

} </style>

   <a href="#"></a>

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

   "content": "project-1.html"

}, {

   "content": "project-2.html"

}, {

   "content": "project-3.html"

}, {

   "content": "project-4.html"

}, {

   "content": "project-5.html"

}, {

   "content": "project-6.html"

}];

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

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

});

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

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

}); </script>