Created
August 13, 2014 22:05
-
-
Save himedlooff/7ee683e93f8137d3e7a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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