Using the prettyPhoto plugin to open modal-style content containers, and trying to integrate with Google Analytics\' Event Tracking to track when videos get opened.
Here is a variant of the solution using the more modern .On() approach.
// Same as .on() but moves the binding to the front of the queue.
$.fn.priorityOn = function (type, selector, data, fn) {
this.each(function () {
var $this = $(this);
var types = type.split(" ");
for (var t in types) {
$this.on(types[t], selector, data, fn);
var currentBindings = $._data(this, 'events')[types[t]];
if ($.isArray(currentBindings)) {
currentBindings.unshift(currentBindings.pop());
}
}
});
return this;
};
Usage is like
$(document).priorityOn("click blur change", ".some .selector input", function (e) {
// Your code.
});