//This version uses show() and hide() instead of visibility var score = 0; $(document).ready(function(){ $('#Trophybutton').click(function() { ClaimTrophy(this.form); }); $('#Checkbutton').prop('title','Double-click this button to float it'); $('#Checkbutton').dblclick(function() { $(this).css({'position':'fixed', 'bottom':'1%','left':'50%','width':'150px','margin-left':'-75px', 'padding-bottom':'0px'}); $(this).prop('title','Click this button often to check your answers'); $('html, body').animate({ scrollTop: 0 }, 'slow'); }); $('#H1Table img').click(function() { window.location.href = '/'; }); }); function trim(str) { return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } function checkAnswers() { score = 0; var AnswerRight = false; if (score < ) { $('#Checkbutton').text('Check again').css({'width':'150px'}); } if (score >= ) { $('#Trophybutton').show(); $('#Trophybutton').val('Claim Your Trophy for ' + score + ' out of '); } if(score==) { $('#Checkbutton').hide(); } } function ClaimTrophy(form) { form.Other_Text.value = score + ' out of '; form.submit(); } function ShowDescription() { $('#GreyOut').show(); $('#DescriptionBox').show(); } function HideDescription() { $('#GreyOut').hide(); $('#DescriptionBox').hide(); } function ShowHelp() { $('#GreyOut').show(); $('#HelpBox').show(); } function HideHelp() { $('#GreyOut').hide(); $('#HelpBox').hide(); } function RemoveSpaces(){ var StudentsText; for (var z=1; z<=; z++ ){ StudentsText = $('input[name=Guess'+z+']').val().split(' ').join(''); StudentsText = StudentsText.replace(//g,''); $('input[name=Guess'+z+']').val(StudentsText); } }