Created
August 9, 2011 02:03
-
-
Save NickCraver/1133270 to your computer and use it in GitHub Desktop.
Stack Exchange search box animation disabler
This file contains hidden or 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
// ==UserScript== | |
// @name Stack Exchange search box animation disabler 1.0 | |
// @namespace stackoverflow | |
// @description Removes Stack Exchange search box animation shenanigans | |
// @include http://stackoverflow.com/* | |
// @include http://*.stackoverflow.com/* | |
// @include http://*.stackexchange.com/* | |
// @include http://serverfault.com/* | |
// @include http://superuser.com/* | |
// @include http://stackapps.com/* | |
// @include http://askubuntu.com/* | |
// @include http://answers.onstartups.com/* | |
// @author Nick Craver | |
// ==/UserScript== | |
function with_jquery(f) { | |
var script = document.createElement("script"); | |
script.type = "text/javascript"; | |
script.textContent = "(" + f.toString() + ")(jQuery)"; | |
document.body.appendChild(script); | |
}; | |
with_jquery(function($) { | |
$(function() { | |
$('#search input[name=q]').unbind("focusin focusout").bind({ | |
blur: function() { this.value = this.value === "" ? "search" : this.value; }, | |
focus: function() { this.value = this.value === "search" ? "" : this.value; } | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment