Mercurial > repos > brasset_jensen > srnapipe
diff lib/sRNAPipe/js/jquery.opacityrollover.js @ 64:967512924317 draft
planemo upload for repository https://github.com/GReD-Clermont/sRNAPipe/ commit 410509088292be0687b8da3ea3bb75e72866a87d
| author | brasset_jensen |
|---|---|
| date | Mon, 28 Jan 2019 11:57:15 -0500 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/sRNAPipe/js/jquery.opacityrollover.js Mon Jan 28 11:57:15 2019 -0500 @@ -0,0 +1,42 @@ +/** + * jQuery Opacity Rollover plugin + * + * Copyright (c) 2009 Trent Foley (http://trentacular.com) + * Licensed under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + */ +;(function($) { + var defaults = { + mouseOutOpacity: 0.67, + mouseOverOpacity: 1.0, + fadeSpeed: 'fast', + exemptionSelector: '.selected' + }; + + $.fn.opacityrollover = function(settings) { + // Initialize the effect + $.extend(this, defaults, settings); + + var config = this; + + function fadeTo(element, opacity) { + var $target = $(element); + + if (config.exemptionSelector) + $target = $target.not(config.exemptionSelector); + + $target.fadeTo(config.fadeSpeed, opacity); + } + + this.css('opacity', this.mouseOutOpacity) + .hover( + function () { + fadeTo(this, config.mouseOverOpacity); + }, + function () { + fadeTo(this, config.mouseOutOpacity); + }); + + return this; + }; +})(jQuery);
