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:
Building on @Raphael_ and @user568109 's answers, in Bootstrap 3, Responsive is now built in.
To detect device type in Javascript, create an object that is only displayed on your required device using Bootstrap's Responsive classes. Then check its :hidden property.
Example:
Create a or, to exclude specific devices: Check value of
#desktopTest:if ($('#desktopTest').is(':hidden')) {
// device is == eXtra Small
} else {
// device is >= SMaller
}