Team:University College London/js/labbookjs
From 2012.igem.org
$(document).ready(function(){
// set up arrows.
$('.experiment').append(''); $('.experiment').append(''); $('.experiment').append('CLICK FOR MORE DETAILS
');
$('.protocol').append('');
$('.experiment').click(function() { if($(this).prev().is(':hidden') == true) { $(this).removeClass('experiment').addClass('experimenton');
$(this).find('.arrowlabel').text("CLICK TO HIDE DETAILS"); $(this).prev().slideDown('normal');
}else{
$(this).addClass('experiment').removeClass('experimenton'); $(this).find('.arrowlabel').text("CLICK FOR MORE DETAILS"); $(this).prev().slideUp('normal');
} });
$('.protocol').click(function() {
if($(this).next().is(':hidden') == true) {
$(this).removeClass('protocol').addClass('protocolon');
$(this).next().slideDown('normal');
}else{
$(this).addClass('protocol').removeClass('protocolon'); $(this).next().slideUp('normal');
}
});
if(window.location.hash){
var id = window.location.hash; $(id).next().next().removeClass('experiment').addClass('experimenton'); $(id).next().show(); $(id).next().next().find('.arrowlabel').text("CLICK TO HIDE DETAILS"); document.getElementById(id.substr(1)).scrollIntoView(true); }
});