This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var furs = ["#FFFFFF", "#F7941D", "#EBEBEB", "#636363", "#C69C6D", "#A186BE", "395A00", "#FFF220"]; | |
$("#picture img").click(function () { | |
var choice = Math.floor(Math.random()*furs.length); | |
$(this).css({ "background-color" : furs[choice] }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var furs = ["#FFFFFF", "#F7941D", "#EBEBEB", "#636363", "#C69C6D", "#A186BE", "395A00", "#FFF220"]; | |
$("#picture img").click(function () { | |
var choice = Math.floor(Math.random()*furs.length); | |
$(this).css({ "background-color" : furs[choice] }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var furs = ["#FFFFFF", "#F7941D", "#EBEBEB", "#636363", "#C69C6D", "#A186BE", "395A00", "#FFF220"]; | |
$("#picture img").click(function () { | |
var choice = Math.floor(Math.random()*furs.length); | |
$(this).css({ "background-color" : furs[choice] }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="picture"> | |
<img src="images/kitty.png"></img> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="food"> | |
<p>nom nom nom</p> | |
<img src="images/nomnom.png"></img> | |
<img class="fish" src="images/fish.png"></img> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#picture img").droppable({ | |
drop: function() { | |
$(this).attr({ src: "images/kitty_nom.png" }); | |
$(this).addClass("eating"); | |
$(".fish").hide(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".fish").draggable({ | |
drag: function() { | |
$("#picture img").attr({ src: "images/kitty_hungry.png" }); | |
revert: true; | |
}, | |
stop: function () { | |
if($("#picture img").hasClass("eating")) { | |
setTimeout(reset_kitty, 2000); | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".fish").draggable({ | |
drag: function() { | |
$("#picture img").attr({ src: "images/kitty_hungry.png" }); | |
revert: true; | |
}, | |
stop: function () { | |
if($("#picture img").hasClass("eating")) { | |
setTimeout(reset_kitty, 2000); | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fishLeft = $('.fish').css('left'); | |
var fishTop = $('.fish').css('top'); | |
function reset_kitty() { | |
$("#picture img").attr({ src: "images/kitty.png" }); | |
$("#picture img").removeClass("eating"); | |
$('.fish').css({top: fishTop, | |
left: fishLeft}); | |
$('.fish').fadeIn("slow"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="talk"> | |
<form> | |
<p>mrow</p> | |
<input type="text" name="rawr" id="user-input" size="10" maxlength="10" /> | |
<input type="submit" name="chat" value="meow" class="subby" /> | |
<h4>max 10 characters</h4> | |
</form> | |
</div> |
OlderNewer