1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-27 18:00:30 +02:00

Use fadeIn and fadeOut for tab visibility...

This commit is contained in:
Lóna Lore
2017-01-21 11:27:36 +01:00
parent d7846f877c
commit cb73f12d55
2 changed files with 44 additions and 10 deletions

View File

@@ -53,6 +53,39 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
})(jQuery);
(function (jQuery)
{
/**
* jQuery extension to make admin tab 'fadeIn' with 'display: inline-block'.
*
* @param displayMode
* A string determining display mode for element after the animation.
* Default: 'inline-block'.
* @param duration
* A string or number determining how long the animation will run.
* Default: 400.
*/
jQuery.fn.fadeInAdminTab = function (displayMode, duration)
{
var $this = $(this);
if($this.css('display') !== 'none')
{
return;
}
displayMode = displayMode || 'inline-block';
duration = duration || 400;
$this.fadeIn(duration, function ()
{
$this.css('display', displayMode);
});
};
})(jQuery);
$(document).ready(function()
{