annotate bin/js/jquery.opacityrollover.js @ 1:1df6aaac800e draft

Deleted selected files
author brasset_jensen
date Wed, 13 Dec 2017 10:40:50 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
1 /**
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
2 * jQuery Opacity Rollover plugin
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
3 *
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
4 * Copyright (c) 2009 Trent Foley (http://trentacular.com)
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
5 * Licensed under the MIT License:
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
6 * http://www.opensource.org/licenses/mit-license.php
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
7 */
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
8 ;(function($) {
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
9 var defaults = {
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
10 mouseOutOpacity: 0.67,
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
11 mouseOverOpacity: 1.0,
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
12 fadeSpeed: 'fast',
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
13 exemptionSelector: '.selected'
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
14 };
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
15
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
16 $.fn.opacityrollover = function(settings) {
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
17 // Initialize the effect
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
18 $.extend(this, defaults, settings);
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
19
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
20 var config = this;
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
21
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
22 function fadeTo(element, opacity) {
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
23 var $target = $(element);
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
24
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
25 if (config.exemptionSelector)
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
26 $target = $target.not(config.exemptionSelector);
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
27
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
28 $target.fadeTo(config.fadeSpeed, opacity);
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
29 }
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
30
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
31 this.css('opacity', this.mouseOutOpacity)
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
32 .hover(
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
33 function () {
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
34 fadeTo(this, config.mouseOverOpacity);
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
35 },
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
36 function () {
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
37 fadeTo(this, config.mouseOutOpacity);
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
38 });
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
39
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
40 return this;
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
41 };
1df6aaac800e Deleted selected files
brasset_jensen
parents:
diff changeset
42 })(jQuery);