Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom animations in tooltips. #13622

Closed
nanuclickity opened this issue May 18, 2014 · 10 comments
Closed

Custom animations in tooltips. #13622

nanuclickity opened this issue May 18, 2014 · 10 comments

Comments

@nanuclickity
Copy link

nanuclickity commented May 18, 2014

Problem

Tooltips only support fade animation. here
Animations should be capable of being outsourced to css.

Benefit: You can use libraries like animate.css in tooltips.

Solution

Integration of custom css animation classes.

To enable tooltip animation you pass { animation: true },
after this you can pass { animation: 'animated bouceInDown'}
and tooltips will automatically use this string as animation class.

Take animate.css for example, it's an awesome collection of CSS3 based animations.

Initialization is kept simplistic.

Dynamic Initialization

$(".music-menu").tooltip({
  animation: 'animated bounceInDown'
});

Auto Initialization

<span data-animation="animated bounceInDown" data-toggle="tooltip" title="Gryffindor"></span>
nanuclickity added a commit to nanuclickity/bootstrap that referenced this issue May 21, 2014
options.animation can now accept a class name and toggle it on show and hide events.
@fat
Copy link
Member

fat commented May 22, 2014

i like this a lot.

I think we should just update the default of the animation option to be "fade". and then allow people to pass in custom animation strings.

backwards compat and adds potentially really cool stuff 👍

@nanuclickity
Copy link
Author

@fat It is ready and looks awesome.
Here's a working demo with animate.css.

Approval for PR? 😉

nanuclickity added a commit to nanuclickity/bootstrap that referenced this issue May 22, 2014
The options.animation default key has been updated to 'fade'.
Animation class modifications are done after everything is ready.
@nanuclickity
Copy link
Author

@fat Given a chance, may i add this to modals, popovers and other possibilities?

@nanuclickity nanuclickity reopened this May 22, 2014
@fat
Copy link
Member

fat commented May 23, 2014

Sounds good to me, would be good to confirm with @twbs/team though. I know they have been thinking about doing more animations… want to make sure this sort of thing would fit in good with their ideas

@mdo
Copy link
Member

mdo commented Jul 7, 2014

Punting to v4.

@mdo mdo closed this as completed Jul 7, 2014
@mdo mdo mentioned this issue Aug 19, 2015
@darma-avalos
Copy link

Hi guys, I am actually looking for this. Is this implemented in BS, could anyone give me a link where I can find info over the implementation. Thanks a bunch !

@nanuclickity
Copy link
Author

@darma-avalos
This isn't implemented yet.
However, an experimental version for BSv4 is hosted here

@nanuclickity
Copy link
Author

nanuclickity commented Jul 20, 2016

@fat @mdo

Update for v4

Current Tooltip Markup

<div class='tooltip'>
  ....
</div>

animation classes and tether.js positioning, both are done on .tooltip root element.

css animations rely heavily on transforms.
tether.js uses css transforms for positioning, and is overriding transforms of css animations.

Proposed

<div class='tooltip'>    // Tether.js acts here
  <div class='tooltip-inner-wrap'>  // Animation acts here
    ...
  </div>
</div>

Implementation

See this commit c748695
Raised a PR #20331

Demo

jsfiddle

@JefferyHus
Copy link

JefferyHus commented Sep 14, 2017

Not yet implemented and your implementation @nanuclickity isn't working in v4_Beta, thanks anyway mate 👍

@nanuclickity
Copy link
Author

Hmm.
I did it for v4_alpha.
I'll update it soon to v4_beta. Didn't realise it was released. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants