Team:UiOslo Norway/Album
From 2014.igem.org
(Difference between revisions)
StianLagstad (Talk | contribs) |
StianLagstad (Talk | contribs) |
||
Line 1: | Line 1: | ||
- | < | + | <div class="container"> |
- | + | <div class="jumbotron text-center"> | |
- | + | <h1>Album</h1> | |
- | + | </div> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | + | ||
- | |||
- | |||
- | |||
- | + | <div class="row"> | |
- | + | <div class="span12 text-center"> | |
- | + | <ul class="nav nav-pills" style="display:inline-block;"> | |
- | + | <li> | |
- | + | <a | |
- | + | href="#" | |
- | + | class="albumLink" | |
- | </a> | + | id="events-link">Events</a> |
+ | </li> | ||
+ | <li> | ||
+ | <a | ||
+ | href="#" | ||
+ | class="albumLink" | ||
+ | id="lab-link">Lab</a> | ||
+ | </li> | ||
+ | <li> | ||
+ | <a | ||
+ | href="#" | ||
+ | class="albumLink" | ||
+ | id="social-link">Social</a> | ||
+ | </li> | ||
+ | <li> | ||
+ | <a href="our_team.php">Team</a> | ||
+ | </li> | ||
+ | </ul> | ||
+ | </div> | ||
+ | </div> | ||
+ | |||
+ | <div class="row borderTopRow"> | ||
+ | |||
+ | <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
+ | <div class="modal-dialog"> | ||
+ | <div class="modal-content"> | ||
+ | <div class="modal-body"> | ||
</div> | </div> | ||
+ | </div><!-- /.modal-content --> | ||
+ | </div><!-- /.modal-dialog --> | ||
+ | </div><!-- /.modal --> | ||
- | + | <div id="events" class="albumDiv"> | |
- | + | ||
- | + | <ul class="row albumStuff"> | |
- | + | ||
- | + | ||
- | + | <li class="col-lg-2 col-md-2 col-sm-3 col-xs-4 imageSpacer"> | |
- | + | <img | |
- | + | class="maxImage" | |
- | + | src="images/album/masterpub.jpg" | |
- | + | alt="Håkon presented iGEM and our team in a masterpub at the university."/> | |
- | + | </li> | |
- | + | ||
- | + | <li class="col-lg-2 col-md-2 col-sm-3 col-xs-4 imageSpacer"> | |
- | + | <img | |
- | + | class="maxImage" | |
- | + | src="images/album/stand.jpg" | |
- | + | alt="Sumaya and William speaking about iGEM and our team with biology students at the university."/> | |
- | + | </li> | |
- | + | ||
- | + | </ul> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | |||
- | |||
- | |||
</div> | </div> | ||
- | <div class=" | + | |
+ | <div id="lab" class="albumDiv"> | ||
+ | |||
+ | <ul class="row albumStuff"> | ||
+ | |||
+ | <li class="col-lg-2 col-md-2 col-sm-3 col-xs-4 imageSpacer"> | ||
+ | <img | ||
+ | class="maxImage" | ||
+ | src="images/album/girls-lab.png" | ||
+ | alt="The girls having fun in the lab."/> | ||
+ | </li> | ||
+ | </ul> | ||
+ | |||
+ | </div> | ||
+ | |||
+ | <div id="social" class="albumDiv"> | ||
+ | |||
+ | <ul class="row albumStuff"> | ||
+ | |||
+ | <li class="col-lg-2 col-md-2 col-sm-3 col-xs-4 imageSpacer"> | ||
+ | <img | ||
+ | class="maxImage" | ||
+ | src="images/album/coffee.jpg" | ||
+ | alt="We found a relic of a coffee maker in our meeting room. People are sceptical, but people must have coffee."/> | ||
+ | </li> | ||
+ | |||
+ | <li class="col-lg-2 col-md-2 col-sm-3 col-xs-4 imageSpacer"> | ||
+ | <img | ||
+ | class="maxImage" | ||
+ | src="images/album/meeting.jpg" | ||
+ | alt="One of our early planning meetings."/> | ||
+ | </li> | ||
+ | |||
+ | </ul> | ||
+ | |||
+ | </div> | ||
+ | |||
+ | </div>Pal | ||
+ | |||
+ | <script> | ||
+ | $(document).ready(function(){ | ||
+ | |||
+ | // set default visible category | ||
+ | $('.albumDiv').hide(); | ||
+ | $('#events').show(); | ||
+ | $('#events-link').parent().attr('class','active'); | ||
+ | |||
+ | // handler for changing categories | ||
+ | $('.albumLink').on('click', function() { | ||
+ | var id = $(this).attr('id').split("-"); | ||
+ | id = id[0]; | ||
+ | // hide all categories | ||
+ | $('.albumDiv').hide(); | ||
+ | // remove class active from all li-elements | ||
+ | $('.albumLink').parent().removeClass('active'); | ||
+ | // show this specific category | ||
+ | $('#' + id).show(); | ||
+ | $('#' + id + '-link').parent().attr('class','active'); | ||
+ | }); | ||
+ | |||
+ | // handler for showing modal | ||
+ | $('li img').on('click',function(){ | ||
+ | |||
+ | var category = $(this).parent().parent().parent().attr('id'); | ||
+ | var src = $(this).attr('src'); | ||
+ | var alt = $(this).attr('alt'); | ||
+ | var img = '<img src="' + src + '" class="img-responsive"/>'; | ||
+ | var imgDesc = '<div class="imgDesc">' + alt + '</div>' | ||
+ | |||
+ | //start of new code new code | ||
+ | var index = $(this).parent('li').index(); | ||
+ | |||
+ | var html = ''; | ||
+ | html += img; | ||
+ | html += imgDesc; | ||
+ | |||
+ | $('#myModal').modal(); | ||
+ | $('#myModal .modal-body').html(html); | ||
+ | |||
+ | }); | ||
+ | |||
+ | }) | ||
+ | |||
+ | </script> |
Revision as of 12:10, 12 August 2014
Album
- <img class="maxImage" src="images/album/masterpub.jpg" alt="Håkon presented iGEM and our team in a masterpub at the university."/>
- <img class="maxImage" src="images/album/stand.jpg" alt="Sumaya and William speaking about iGEM and our team with biology students at the university."/>
- <img class="maxImage" src="images/album/girls-lab.png" alt="The girls having fun in the lab."/>
<script> $(document).ready(function(){
// set default visible category $('.albumDiv').hide(); $('#events').show(); $('#events-link').parent().attr('class','active');
// handler for changing categories $('.albumLink').on('click', function() { var id = $(this).attr('id').split("-"); id = id[0]; // hide all categories $('.albumDiv').hide(); // remove class active from all li-elements $('.albumLink').parent().removeClass('active'); // show this specific category $('#' + id).show(); $('#' + id + '-link').parent().attr('class','active'); });
// handler for showing modal $('li img').on('click',function(){
var category = $(this).parent().parent().parent().attr('id'); var src = $(this).attr('src'); var alt = $(this).attr('alt'); var img = '<img src="' + src + '" class="img-responsive"/>';var imgDesc = '
' + alt + '
'
//start of new code new code var index = $(this).parent('li').index();
var html = ; html += img; html += imgDesc;
$('#myModal').modal(); $('#myModal .modal-body').html(html); });
})
</script>