Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Twitter Bootstrap and jQuery UI at the same time?

I am using Twitter Bootstrap and I want to use an "auto-suggest" which is not available in Bootstrap, whereas jQuery UI has its own methods for auto-suggest.

Can I use both? Will it overload the bandwidth?

like image 570
Sanket Sahu Avatar asked Jan 28 '12 20:01

Sanket Sahu


People also ask

Can I use Bootstrap and jQuery together?

It's possible! Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery. If Bootstrap detects jQuery in the window object it'll add all of our components in jQuery's plugin system; this means you'll be able to do $('[data-bs-toggle="tooltip"]').

Do you need jQuery with Bootstrap?

Bootstrap uses jQuery for JavaScript plugins (like modals, tooltips, etc). However, if you just use the CSS part of Bootstrap, you don't need jQuery.

Why Bootstrap does not use jQuery?

The Bootstrap 5 framework has removed jQuery as a requirement. It saved 85KB of minified JavaScript, which could be significant as Google starts to use page speed as a ranking factor for mobile web sites, and soon for desktop web sites as well.


2 Answers

Check out jquery-ui-bootstrap. From the README:

Twitter's Bootstrap was one of my favorite projects to come out of 2011, but having used it regularly it left me wanting two things:

The ability to work side-by-side with jQuery UI (something which caused a number of widgets to break visually) The ability to theme jQuery UI widgets using Bootstrap styles. Whilst I love jQuery UI, I (like others) find some of the current themes to look a little dated. My hope is that this theme provides a decent alternative for others that feel the same. To clarify, this project doesn't aim or intend to replace Twitter Bootstrap. It merely provides a jQuery UI-compatible theme inspired by Bootstrap's design. It also provides a version of Bootstrap CSS with a few (minor) sections commented out which enable the theme to work along-side it.

like image 100
Sam Dolan Avatar answered Sep 20 '22 09:09

Sam Dolan


just to update this, bootstrap v2 no longer conflicts with jquery ui

https://github.com/twbs/bootstrap/issues/171

Edit: as @Freshblood there are a few things that still conflict. However, as originally posted Twitter suggests that they are working on this and it largely works, specially compared to v1.

like image 45
Eonasdan Avatar answered Sep 21 '22 09:09

Eonasdan