Team:University College London/js/labbookjs
From 2012.igem.org
(Difference between revisions)
(One intermediate revision not shown) | |||
Line 2: | Line 2: | ||
// set up arrows. | // set up arrows. | ||
- | $('.experiment').append('<div class="arrow" style="left: | + | $('.experiment').append('<div class="arrow" style="left:308px"></div>'); |
- | $('.experiment').append('<div class="arrow" style="left: | + | $('.experiment').append('<div class="arrow" style="left:650px"></div>'); |
$('.experiment').append('<div class="arrowlabel">CLICK FOR MORE DETAILS</div>'); | $('.experiment').append('<div class="arrowlabel">CLICK FOR MORE DETAILS</div>'); | ||
Line 12: | Line 12: | ||
if($(this).prev().is(':hidden') == true) { | if($(this).prev().is(':hidden') == true) { | ||
$(this).removeClass('experiment').addClass('experimenton'); | $(this).removeClass('experiment').addClass('experimenton'); | ||
- | $(this).find('.arrowlabel').text("HIDE DETAILS"); | + | $(this).find('.arrowlabel').text("CLICK TO HIDE DETAILS"); |
$(this).prev().slideDown('normal'); | $(this).prev().slideDown('normal'); | ||
}else{ | }else{ | ||
$(this).addClass('experiment').removeClass('experimenton'); | $(this).addClass('experiment').removeClass('experimenton'); | ||
- | $(this).find('.arrowlabel').text(" | + | $(this).find('.arrowlabel').text("CLICK FOR MORE DETAILS"); |
$(this).prev().slideUp('normal'); | $(this).prev().slideUp('normal'); | ||
} | } |
Latest revision as of 15:41, 29 August 2012
$(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); }
});