Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var question = questions[Math.floor(Math.random()*questions.length)];
- var current = question.number;
- var collapsed = 0;
- var variable = ""
- $(document).ready(function() {
- writeQueryVariable();
- writeCount();
- $('body').on('click', '#flip-1', function(){
- $('#question').fadeOut('400');
- $('#answer-1').fadeIn('400', function() {
- writeQuestion();
- });
- });
- $('body').on('click', '#flip-2', function(){
- $('#question').fadeOut('400');
- $('#answer-2').fadeIn('400', function() {
- writeQuestion();
- });
- });
- $('body').on('click', '.flop', function(){
- $('.answer').fadeOut('400');
- $('#question').fadeIn('400', function(){
- writeAnswer();
- $.ajax({ url: 'script.php' });
- writeCount();
- });
- });
- $('body').on('click', '.btn-submit', function(){
- $('.panel-content').fadeOut('400');
- $('.panel-thanks').fadeIn('400');
- });
- $('#closelink').click(function(){
- if (collapsed == 0) {
- $('#close').fadeTo('slow', 1.0);
- collapsed = 1;
- }
- else {
- $('#close').fadeTo('slow', 0.0);
- collapsed = 0;
- }
- });
- if (variable == "") {
- mainLoad();
- htmlVariable("nothing");
- }
- else if (variable != ""){
- numberofquestions = questions.length;
- if (variable <= numberofquestions) {
- question = questions[variable]
- mainLoad();
- htmlVariable("in bounds");
- randomQuestion();
- }
- else {
- mainLoad();
- htmlVariable("outta bounds");
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement