Skip to content

Instantly share code, notes, and snippets.

@NickCraver
Created August 9, 2011 02:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save NickCraver/1133270 to your computer and use it in GitHub Desktop.
Save NickCraver/1133270 to your computer and use it in GitHub Desktop.
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