diff options
| author | laurence <laurenceseo99@gmail.com> | 2013-09-06 14:45:44 +0800 |
|---|---|---|
| committer | laurence <laurenceseo99@gmail.com> | 2013-09-06 14:45:44 +0800 |
| commit | 8e497ca8a99e8055d51427d07219a6c883426856 (patch) | |
| tree | eae5aa1ad57a4b62f1e9282a46fe01f21edf6319 /js/colorpicker.js | |
| parent | cc873672d0a997d150770b116b2ea2c99f31b845 (diff) | |
laurence
Diffstat (limited to 'js/colorpicker.js')
| -rw-r--r-- | js/colorpicker.js | 54 |
1 files changed, 38 insertions, 16 deletions
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'});
|
