Skip to content

Commit

Permalink
Put the reset functions back into the document.ready function. Change…
Browse files Browse the repository at this point in the history
…d all of the .html functions to .text. Changed the reset_meow to have empty values for .text as opposed to &nbsp for .html
  • Loading branch information
Jensen Hussey committed Oct 26, 2009
1 parent 129cab3 commit f09bbff
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
function reset_meow() {
$("h3").html("&nbsp");
$("h1").html("&nbsp");
$("#speech").removeClass("speech-bubble");
$("#meow").removeClass("input-bubble");
}
$(document).ready(function(){

function reset_kitty() {
$("#picture img").attr({ src: "images/kitty.png" });
$('.fish').css({top: fishTop,
left: fishLeft});
$('.fish').fadeIn("slow");
}
function reset_kitty() {
$("#picture img").attr({ src: "images/kitty.png" });
$('.fish').css({top: fishTop,
left: fishLeft});
$('.fish').fadeIn("slow");
}


$(document).ready(function(){
var fishLeft = $('.fish').css('left');
var fishTop = $('.fish').css('top');
var furs = ["#FFFFFF", "#F7941D", "#EBEBEB", "#636363", "#C69C6D", "#A186BE", "395A00", "#FFF220"];
Expand All @@ -34,12 +29,11 @@ $(document).ready(function(){
$(".fish").draggable({
drag: function() {
$("#picture img").attr({ src: "images/kitty_hungry.png" });
revert: true
revert: true;
},
stop: function () {
if($("#picture img").hasClass("eating")) {
setTimeout(reset_kitty, 2000);

}
else {
reset_kitty();
Expand All @@ -49,33 +43,41 @@ $(document).ready(function(){
});


function reset_meow() {
$("h3").text("");
$("h1").text("");
$("#speech").removeClass("speech-bubble");
$("#meow").removeClass("input-bubble");
}


$("form").submit(function () {
var english = $("#rawr").val();
var count = english.length;

$("#speech").addClass("speech-bubble");

if(english == ""){
$("h1").html(" mrow? ");
$("h1").text(" mrow? ");
$("#picture img").attr({ src: "images/kitty_confused.png" });
}

else {
$("#meow").addClass("input-bubble");
$("h3").html(" " + english + " ");
$("h3").text(" " + english + " ");
$("#picture img").attr({ src: "images/kitty_meow.png" });


if(count <= 4){
$("h1").html(" mew ");
$("h1").text(" mew ");
}

if(count >= 5){
$("h1").html(" Meoww ");
$("h1").text(" Meoww ");
}

if(count == 10){
$("h1").html(" rawr ");
$("h1").text(" rawr ");
}

}
Expand Down

0 comments on commit f09bbff

Please sign in to comment.