0

I am working on a project where I am using Twitter Bootstrap Framework. I am also using the jQuery UI library. The problem is that in these two libraries there are a few functions with the same name, eg tooltip. Now when I apply this function to any element, the function with the last declaration is being applied.

For example if I include the jQuery UI library after the Bootstrap library, and use

$("element").tooltip();

The tooltip() function in jQuery UI is called. I know I can achieve the desired result by removing the given function from one of the library or by rearranging the position of libraries. But I wanted to know whether there is any way to specify which library's function is to be called when there are two libraries sharing the same function name.

2 Answers 2

1

No there is no way to use both functions at the same time. Both functions are added into $() Object through prototype. So maybe you should rename one of this, or use only one.

Sign up to request clarification or add additional context in comments.

Comments

1

You can rename one plugin after it is loaded, and before you load the next one. Something like $.fn.jqueryui_tooltip = $.fn.tooltip; and only then load Twitter's library.

1 Comment

I would like to use it, but unfortunately it is not working. Can you please explain a bit more?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.