Jump to content


Photo
- - - - -

Twitter Bootstrap behaviour on navbar

twitter bootstrap navbar menu behaviour customise

Best Answer James B , 27 May 2013 - 09:24 PM

Hi there,

 

The Navbar isn't unfortunately able to accomodate a link as well as an anchor. The reason for this is due to the rise in mobile/repsonsive sites which use touch screen devices. Somone trying to access the nav using a touch screen device would also activate the link and then lose the drop down when the page redirected.

 

There's no official way to do this that I'm aware of, as it will probably be a js hack. There are some posts on google relating to fixing this inside bootstrap by changing the class, but they seem to disable the drop down menu and only activate the link.

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 catpage

catpage

    Advanced Member

  • Members
  • 33 posts
  • Country: Country Flag

Posted 27 May 2013 - 08:48 PM

In another thread when questioning why a click on a top level menu item in the new navbar does not link to the relevant page as it does with the classic navbar the response was "Twitter does it this way for a reason." - I assume this is to follow their interface standards? Both myself and others would prefer the behaviour of the classic navbar applied to the new one. The workaround of adding back the same page as a 'sub link' on the menu is not ideal and can even be confusing. Is there no way of overriding Twitter Bootstrap limitations? An add-on or hack of some kind?

 



#2 James B

James B

    Advocate

  • Moderators
  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 27 May 2013 - 09:24 PM   Best Answer

Hi there,

 

The Navbar isn't unfortunately able to accomodate a link as well as an anchor. The reason for this is due to the rise in mobile/repsonsive sites which use touch screen devices. Somone trying to access the nav using a touch screen device would also activate the link and then lose the drop down when the page redirected.

 

There's no official way to do this that I'm aware of, as it will probably be a js hack. There are some posts on google relating to fixing this inside bootstrap by changing the class, but they seem to disable the drop down menu and only activate the link.



#3 catpage

catpage

    Advanced Member

  • Members
  • 33 posts
  • Country: Country Flag

Posted 27 May 2013 - 09:40 PM

OK sounds like a very good reason! Thanks for the explanation.



#4 James B

James B

    Advocate

  • Moderators
  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 27 May 2013 - 10:03 PM

You're welcome :-)







Also tagged with one or more of these keywords: twitter bootstrap, navbar, menu, behaviour, customise