Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(function( $ ) {
$.fn.revealOnFocus = function( userSettings ) {
return $( this ).each(function() {
var $this = $( this ),
$target = $this.find('.reveal-on-focus_target'),
$content = $this.find('.reveal-on-focus_content');
$content.hide();
$target.on('focus', function() {
var duration = $.fn.expandable.calculateExpandDuration( $content.height() );
$content.slideDown({
duration: duration,
easing: 'easeOutExpo'
});
});
});
};
// Auto init
$('.reveal-on-focus').revealOnFocus();
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.