Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Stack Exchange search box animation disabler
// ==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
You can’t perform that action at this time.