Comments (13)
@banya --> That link/issue you posted doesn't exist?
I also would love to see this plugin with animation capability. Is there any way we can just utilize css3 animations to get this done in the meantime?
Thanks,
-Drew
from messenger.
You absolutely can, CSS animations can do whatever wiggle or slide you can think of when the message element is added to the page.
Way back when there was a branch which added support for animate.css, a library that allows you to animate anything with the right css classes. I believe that the only change that has to be made for this to work is the ability to add extra classes to messages.
from messenger.
thanks for the reply:
so I'm using the following transition css:
ul.messenger li.messenger-message-slot {
opacity: 1;
-webkit-transition: opacity 2.5s ease-out, -webkit-transform 2.5s ease-out;
-moz-transition: opacity 2.5s ease-out, -moz-transform 2.5s ease-out;
-o-transition: opacity 2.5s ease-out, -o-transform 2.5s ease-out;
transition: opacity 2.5s ease-out, transform 2.5s ease-out;
}
How can I adapt that to work with messenger? The plugin seems to automatically display the messages and ignore the transition.
thanks!
from messenger.
That's a CSS transition. It could only really work if messenger rendered the message, forced a repaint, then applied a class you could transition to. This is not supported right now.
You can however use CSS animations, e.g. https://github.com/daneden/animate.css/blob/master/source/bouncing_entrances/bounceIn.css
from messenger.
@zackbloom That is awesome. Is there a way to do animation while dismissing too?
from messenger.
@seifsallam Yes, when we hide a message we apply the messenger-hidden
class, so if you add an animation to that class, it will animate on hide.
from messenger.
@zackbloom I've tried adding animation there but no luck, it just disappears
from messenger.
Make sure you're overriding the built-in themes which make messenger-hidden
actually hide the messages.
Something like
.messenger-hidden {
display: block !important;
}
would be worth trying.
from messenger.
Truthfully though, none of this will work particularly well if there is more than one message shown at a time. @adamschwartz has some ideas about how we might add more robust support.
from messenger.
Not working either, but thanks
from messenger.
Did anyone get this working?
from messenger.
Even if unofficial, a third party plugin/addition that added subtle animations/fades would be awesome.
from messenger.
I've an Idea that worked for me, but it's a quirk code at the moment
in the messenger.js search for line
this.$message.addClass('messenger-will-hide-after');
and after that add this
////mia aggiunta
if (this.options.hideAfter > 1) {
this._hidingTimeout = setTimeout(function () {
_this.$message.addClass('messenger-hiding');
}, (this.options.hideAfter * 1000) - 1000);
}
////fine mia aggiunta
and search for
this.$message.removeClass('messenger-hidden');
and chang it to
this.$message.removeClass('messenger-hidden').removeClass('messenger-hiding');
shortly, if hideAfter > 1 second, then before 1 second it trigger my custom function and add the class
messenger-hiding
add that point, in your css you can do whatever effect you want to dismiss the dialog, knowing that you have 1 second to do that
of coure this solution suck because it's tailored on my needs of the moment, the right thing (very easy tbh) is to add another timer that trigger before _hidingTimeout
(_hidingTimeout could even be triggered inside this new timed function)
my css was this
ul.messenger .messenger-message {
overflow: hidden;
*zoom: 1;
opacity: 1;
/* Firefox */
-moz-transition-property: opacity;
-moz-transition-duration: 0.5s;
/* WebKit */
-webkit-transition-property: opacity;
-webkit-transition-duration: 0.5s;
/* Opera */
-o-transition-property: opacity;
-o-transition-duration: 0.5s;
/* Standard */
transition-property: opacity;
transition-duration: 0.5s;
}
ul.messenger .messenger-message.messenger-hiding {
opacity: 0;
}
if i find the time i could fork, change and pull-request
from messenger.
Related Issues (20)
- How to show actions only on success (ajax)
- Keep ajax request running if client get disconnected for a few seconds
- can it support webpack? HOT 14
- Does Messenger work with Jquery promise?
- Any examples that work using parentLocations? HOT 2
- Not loading status when click HOT 1
- Call functions within the alert
- Avoid live dependency on fonts.googleapis.com HOT 1
- Uses CSS class div.success - conflicts with my own site's div.success
- Can't "import" or "require" messenger with JS HOT 7
- How to reload window after Messenger().run() message closes?
- Set sticky message
- http://fonts.gstatic.com/s/raleway/v11/QAUlVt1jXOgQavlW5wEfxQLUuEpTyoUstqEm5AMlJo4.woff2
- nuget Version not update
- Cannot read property 'Message' of undefined
- Can't override the theme on a single message? HOT 1
- package.json should have main attribute HOT 1
- import not working after installing npm package in React
- How to change Messenger Spinner Color?
- Use in angular 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from messenger.