-
Notifications
You must be signed in to change notification settings - Fork 11
/
jquery.tongue.min.js
13 lines (8 loc) · 1.11 KB
/
jquery.tongue.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
Tongue jQuery Plugin
Version: 1.0
Author: Muhammad Usman
Author URI: http://usman.it
Copyright (c) 2012, Muhammad Usman
*/
(function(a){"use strict";a.fn.tongue=function(b){var c=a.extend({position:"bottom",tongue_content:".tongue-content",start_speed:500,end_speed:400},b);var d=this.selector;var e=a(this);a(document).on("mouseenter",d,function(b){var d=a(this).find(c.tongue_content);d.remove();if(c.position=="bottom"){d.appendTo(a(this))}else{d.prependTo(a(this))}d.show();d.stop().animate({marginTop:-2},c.start_speed)});a(document).on("mouseleave",d,function(b){var d=a(this).find(c.tongue_content);var e=-1*d.prop("offsetHeight");d.stop().animate({marginTop:e},c.end_speed,function(){d.hide()})});return this.each(function(){var b=a(this).find(c.tongue_content);var d=-1*b.prop("offsetHeight");if(c.position=="bottom"){a(this).css({position:"relative","z-index":"1",overflow:"visible"});b.css({position:"absolute","z-index":"-1","margin-top":d,display:"none"})}else{a(this).css({position:"relative","z-index":"1",overflow:"hidden"});b.css({position:"absolute","z-index":"2","margin-top":d,display:"none"})}})}})(jQuery)