Team:University College London/js/initjs
From 2012.igem.org
(Difference between revisions)
Line 54: | Line 54: | ||
$.ajax({ | $.ajax({ | ||
url: "https://2012.igem.org/wiki/index.php?title=Team:University_College_London/Bibliography/"+title+"&action=raw", | url: "https://2012.igem.org/wiki/index.php?title=Team:University_College_London/Bibliography/"+title+"&action=raw", | ||
- | success: function(data){$('#footnote-box-content'). | + | success: function(data){$('#footnote-box-content').html(data); footnotebox.show();}, |
}); | }); | ||
}); | }); | ||
$('#footnote-close').click(function(){footnotebox.hide();}); | $('#footnote-close').click(function(){footnotebox.hide();}); | ||
}); | }); |
Latest revision as of 10:18, 9 August 2012
$(document).ready(function(){
$('#wikimenutoggleon').click(function(){ $('#top-section').show(); $('#wikimenutoggleoff').show(); $('#wikimenutoggleon').hide(); });
$('#wikimenutoggleoff').click(function(){
$('#top-section').hide(); $('#wikimenutoggleoff').hide(); $('#wikimenutoggleon').show(); });
var ucligem = $('#ucligem');
// GLOSSARY
ucligem.append('');var glossarybox = $('#glossary-box');
$('.glossary').each(function() {
$this = $(this); $.data(this, 'title', $this.attr('title')); $this.removeAttr('title'); });
$('.glossary').mouseenter(function(e){
var caller = $(this); var title = $.data(this,'title'); var left = e.pageX - ucligem.offset().left - 150; // -150 as width is 300 if(left < 0) { left = 0; } else if(left > 690) { left = 690; } glossarybox.css({"left":left,"top":e.pageY+30}); $.ajax({ url: "https://2012.igem.org/wiki/index.php?title=Team:University_College_London/Glossary/"+title+"&action=raw", success: function(data){glossarybox.text(data); glossarybox.show();}, }); }).mouseout(function(){glossarybox.hide();});
// FOOTNOTES
ucligem.append('');
var footnotebox = $('#footnote-box');
$('.footnote').each(function() {
$this = $(this); $.data(this, 'title', $this.attr('title')); $this.removeAttr('title'); });
$('.footnote').click(function(e){
var caller = $(this); var title = $.data(this,'title'); var left = e.pageX - ucligem.offset().left - 150; // -150 as width is 300 if(left < 0) { left = 0; } else if(left > 690) { left = 690; } footnotebox.css({"left":left,"top":e.pageY+30}); $.ajax({ url: "https://2012.igem.org/wiki/index.php?title=Team:University_College_London/Bibliography/"+title+"&action=raw", success: function(data){$('#footnote-box-content').html(data); footnotebox.show();}, }); });
$('#footnote-close').click(function(){footnotebox.hide();}); });