I think Chris Coyier does something like what you’re describing on this very site.
Resize this page. Out wide the Search box is inline with the tabs… slightly narrower it drops down…. narrower still and the tabs get thinner…. until finally the tabs style change altogether
With a bit of Chrome: Dev tools, or firefox: firebug extension you might be able to figure it out