I have just started to play around with Twitter Bootstrap API for a project I have coming up. The main nav contains 3 main elements:
My answer is using similar mechanism like the one presented by @Raphael_ however, you can do a little bit more with it. Please refer to this answer for details and project's github repository for the most updated version.
Example of breakpoint detection:
if ( viewport.is('xs') ) {
// do stuff in the lowest resolution
}
Executing code on window resize (without it happening multiple times within a span of milliseconds):
$(window).bind('resize', function() {
viewport.changed(function() {
// do some other stuff!
})
});