source: extensions/pwgCumulus/js/colorpicker.instance.js

Last change on this file was 11344, checked in by nikrou, 13 years ago

Remove dependency to swfObject
Allow admin to use animation in main menu

File size: 1.2 KB
Line 
1$(function() {
2    $('input.pwg-picker')
3      .each(function() {
4          if ($(this).val() !== undefined) {
5            if ($(this).val().indexOf('#',0)==-1) {
6              $(this).css('background-color', '#'+$(this).val());
7            } else {
8              $(this).css('background-color', $(this).val());
9            }
10      }
11        })
12      .ColorPicker({
13        onSubmit: function(hsb, hex, rgb, el) {
14            $(el).val(hex);
15            $(el).ColorPickerHide();
16            $(el).css('background-color', '#'+hex);
17          },
18            onBeforeShow: function () {
19            $(this).ColorPickerSetColor(this.value);
20          }
21        })
22      .bind('keyup', function(){
23          $(this).ColorPickerSetColor(this.value);
24        });
25
26    if ($('#pwg_cumulus_mode_transparent').is(':checked')) {
27      $('#pwg_cumulus_p_bgcolor')     
28        .css('opacity', '0.3')
29        .children().children('input').attr('disabled', 'disabled');
30    }
31    $('#pwg_cumulus_mode_transparent')
32      .click(function() {
33          if ($(this).is(':checked')) {
34            $('#pwg_cumulus_p_bgcolor')
35              .animate({opacity:'-=0.7'}, 500)
36              .children().children('input').attr('disabled', 'disabled');
37          } else {
38            $('#pwg_cumulus_p_bgcolor')
39              .animate({opacity:'+=0.7'}, 500)
40              .children().children('input').removeAttr('disabled');
41          }
42        });
43  });
Note: See TracBrowser for help on using the repository browser.