From 8e497ca8a99e8055d51427d07219a6c883426856 Mon Sep 17 00:00:00 2001 From: laurence Date: Fri, 6 Sep 2013 14:45:44 +0800 Subject: laurence --- js/colorpicker.js | 54 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 16 deletions(-) (limited to 'js/colorpicker.js') diff --git a/js/colorpicker.js b/js/colorpicker.js index 9e2bfd6..785d430 100644 --- a/js/colorpicker.js +++ b/js/colorpicker.js @@ -12,6 +12,7 @@ var selectedname = ""; var selectedrgb; //---------element objects---------- var transbutton = $('#transbutton'); +var submitvalue = $('#submitvalue'); var preview = $('#preview'); var colornames = $('#colornames'); var namespace = $('#namespace'); @@ -72,6 +73,27 @@ var ColorPicker = { }); transbutton.hover(function(){ transbutton.addClass('hovertrans')}, function(){ transbutton.attr('class','defaulttrans')}); + submitvalue.hover(function(){ submitvalue.addClass('hovertrans')}, + function(){ submitvalue.attr('class','defaulttrans')}); + submitvalue.click(function() { + + }); + $('.bgOptions').click(function(){ + if (this.id == "bg1") + { + $('#colorpicker').css({'background-image':'url("./images/bg.dither.gif")','background-color':'gray','background-color':'black'}); + }else if(this.id == "bg5"){ + $('#' + this.id).bind('keypress', function(event){ + var key = event.which || event.keyCode; + if(key === 13) { + $('#colorpicker').css({'background-image':"url('" + $('#bgURI').val() + "')"}); + $('#bgURI').val(''); + } + }); + }else{ + $('#colorpicker').css({'background-image':'none','background-color':$('#' + this.id).html().toLowerCase()}); + } + }); //--------event handler over colorpanel------- var firstwidth; $('.colors').mouseover(function() { @@ -105,21 +127,21 @@ var ColorPicker = { //-------------others handler------------------------------- infoswitch.hover(function(){infospace.show()}, function(){infospace.hide('slow')} ); infoswitch.click(function(){ColorPicker.switchcolorinfo()}); - backgroundswitch.clicked = false; - backgroundswitch.click(function(){ - if (! backgroundswitch.clicked){ - bg_menu.slideDown("fast", function(){ - backgroundswitch.clicked = true; - backgroundswitch.addClass("switches_depressed"); - }); - }else{ - bg_menu.slideUp("fast", function(){ - backgroundswitch.clicked = false; - backgroundswitch.removeClass("switches_depressed"); - }) - } - }); -// backgroundswitch.hover(function(){}, function(){bg_menu.hide();}); + backgroundswitch.clicked = false; + backgroundswitch.click(function(){ + if (! backgroundswitch.clicked){ + bg_menu.slideDown("fast", function(){ + backgroundswitch.clicked = true; + backgroundswitch.addClass("switches_depressed"); + }); + }else{ + bg_menu.slideUp("fast", function(){ + backgroundswitch.clicked = false; + backgroundswitch.removeClass("switches_depressed"); + }) + } + }); + hexswitch.click(function(){ColorPicker.hexcolorswitch()}); $('.theswitches').hover(function(){ ColorPicker.switchhovercss(this.id, 'over') }, function(){ ColorPicker.switchhovercss(this.id, 'out') }); @@ -220,7 +242,7 @@ var ColorPicker = { colornames.css('font-size', ColorPicker.GoldenFuncs.goldenize(fontratiotwo)+'px'); colornames.css('text-shadow', 'black 1px 2px'); var transfont = ColorPicker.GoldenFuncs.regolden(fontratioone); - $('.smalltitle').css({'width':'100%','font-size':transfont}); + $('.smalltitle').css({'width':'100%','font-size':fontratioone}); }, setupsides: function() { container.css({'position':'relative','z-index':'1'}); -- cgit v1.2.3-70-g09d2