Skip to content

Instantly share code, notes, and snippets.

@jensechu
Created October 26, 2009 21:25
Show Gist options
  • Save jensechu/219054 to your computer and use it in GitHub Desktop.
Save jensechu/219054 to your computer and use it in GitHub Desktop.
$("form").submit(function () {
var english = $("#user-input").val();
var count = english.length;
$("#kitty-speech").addClass("kitty-bubble");
if(english == ""){
$("h1").text(" mrow? ");
$("#picture img").attr({ src: "images/kitty_confused.png" });
}
else {
$("#user-speech").addClass("input-bubble");
$("h3").text(" " + english + " ");
$("#picture img").attr({ src: "images/kitty_meow.png" });
if(count <= 4){
$("h1").text(" mew ");
}
if(count >= 5){
$("h1").text(" Meoww ");
}
if(count == 10){
$("h1").text(" rawr ");
}
}
setTimeout(reset_kitty, 2000);
setTimeout(reset_meow, 2000);
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment