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
# Require any additional compass plugins here. | |
# Set this to the root of your project when deployed: | |
http_path = "/" | |
css_dir = "/" | |
sass_dir = "sass" | |
images_dir = "images" | |
javascripts_dir = "js" | |
fonts_dir = "fonts" |
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
EventUtil.addHandler(window, "load", function() { | |
var question1 = { | |
question: "What's Josh's favorite color?", | |
choices: ["red", "green", "blue"], | |
correctAnswer: 1 | |
}, | |
question2 = { | |
question: "What's Josh's favorite animal?", |
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
// Form Serialization | |
function serialize(form) { | |
var parts = [], | |
field = null, | |
i, | |
len, | |
j, | |
optLen, | |
option, | |
optValue; |
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
// Chapter 13 | |
// Doesn't work | |
// var image = document.getElementById("10-Reasons"); | |
// EventUtil.addHandler(image, "load", function(event){ | |
// event = EventUtil.getEvent(event); | |
// alert(EventUtil.getTarget(event).src); | |
// }); | |
// works! |
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
// Chapter 13 | |
// Doesn't work | |
// var image = document.getElementById("10-Reasons"); | |
// EventUtil.addHandler(image, "load", function(event){ | |
// event = EventUtil.getEvent(event); | |
// alert(EventUtil.getTarget(event).src); | |
// }); | |
// works! |
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 closeNotice = document.querySelector(".close-notice"); | |
var notice = document.getElementById("notice"); | |
EventUtil.addHandler(closeNotice, "click", function(event){ | |
event = EventUtil.getEvent(event); | |
EventUtil.preventDefault(event); | |
alert("hello there"); | |
notice.setAttribute("class", "hide"); | |
}); | |
#notice { |
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 EventUtil = { | |
addHandler: function(element, type, handler){ | |
if (element.addEventListener){ | |
element.addEventListener(type, handler, false); | |
} else if (element.attachEvent){ | |
element.attachEvent("on" + type, handler); | |
} else { | |
element["on" + type] = handler; | |
} | |
}, |
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 EventUtil = { | |
addHandler: function(element, type, handler){ | |
if (element.addEventListener){ | |
element.addEventListener(type, handler, false); | |
} else if (element.attachEvent){ | |
element.attachEvent("on" + type, handler); | |
} else { | |
element["on" + type] = handler; | |
} | |
}, |
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
(function($){ | |
$.fn.printy = function(options) { | |
settings = $.extend({ | |
limit : 15 | |
}, options); | |
return this.each(function() { |