Comments (6)
There isn't such a feature yet and I think that by now I am not able to add it! When I will manage to do it, I will certainly add it! Some help would be great!
simple-sidebar and simpler-sidebar are developed at the simple-sidebar organization, since I want to move there all sidebars repos!
from sidebar.
Updated the main JS file and ran it through your linter via grunt.... here's the PR: #22
Now you could run some extra JS in an application by using something like:
$( 'body' ).on( 'open.panel', function (e) {
// do some stuff
});
or:
$( 'body' ).on( 'close.panel', function (e) {
// do some stuff
});
from sidebar.
The code would be changed to be a fully functional plugin. In your way the event driven callbacks will be available for all instances instead of being able for the instance of the object.
I will add this functionality soon. I'm already working on it, but in the jquery plugin way:
$sidebar.simplerSidebar( {
// Other Options
callbacks: {
onClose: function() {},
onOpen: function() {}
}
} );
from sidebar.
@dcdeiv that works for me. I only have one instance of the sidebar in my application, but ideally, you're right!
from sidebar.
from sidebar.
This is now possible in v2.0.2.
Quoting the changelog:
3 - Add the ability to set custom functions to run when/after all the animations are triggered. #21-#22
In the options there is a brand new feature: events
. This wrapper will handle all your functions according to some events that occur in the plugin. By now I have added only the animation
event.
You can add some custom functions to be triggered when/after the animations.
events.on.animation
will handle all your custom functions that must be run when the animation is triggered.events.callbacks.animation
will handle all your custom functions that must be run after the animation has been triggered.open
in the animation that opens the sidebar.close
is the animation that closes the sidebar.both
will run your custom functions on both animations.
var callopen = function() {
alert( "callback called after the sidebar's been opened" );
},
callclose = function() {
alert( "callback called after the sidebar's been closed" );
},
callboth = function() {
alert( "callback called after both animations" );
},
onopen = function() {
alert( "function called while the sidebar is opening" );
},
onclose = function() {
alert( "function called while the sidebar is closing" );
},
onboth = function() {
alert( "function called while both animations are triggered" );
};
$( "#sidebar" ).simplerSidebar( {
// Required options are skipped in this example
events: {
on: {
animation: {
open: onopen,
close: onclose,
both: onboth
}
},
callbacks: {
animation: {
open: callopen,
close: callclose,
both: callboth
}
}
}
} );
from sidebar.
Related Issues (19)
- Triggering animation after clicking HOT 3
- Any option to trigger with code hide/show HOT 10
- Mask over the sidebar HOT 2
- Mask over the sidebar
- Bugs in README options HOT 1
- How to scroll the page when side bar is opened ? HOT 8
- Keep Scrollbar HOT 25
- link to working examples HOT 3
- init: opened
- any animation in the side panel causes it to close HOT 5
- Multiple sidebars do not hide correctly HOT 1
- 'Readme - Getting Started' needs revision; I followed it and get a blank page. HOT 5
- overflow: initial causes IE's scrollbar to disappear forever HOT 2
- animate and easing bugs? HOT 6
- Triggerless run HOT 1
- prevent page from jumping once the scrollbar disappears and the sidebar opens.
- Resize Issue HOT 2
- jQuery 2.x compatibility HOT 3
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 sidebar.