AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL,FLASH, jQuery, java, for loop, switch case, if, if else, for...of, for...in, for...each,while loop, blogger tips, blogger meta tag generator, blogger tricks, blogger pagination, client side script, html code editor, javascript editor with instant output, css editor, online html editor, materialize css tutorial, materialize css dropdown list,break, continue statement, label,array, json, get day and month dropdown list using c# code, CSS button,protect cd or pendrive from virus, cordova, android example, html and css to make android app, html code play,telerik show hide column, Transparent image convertor, copy to clipboard using javascript without using any swf file, simple animation using css, SQL etc. AllInWorld99 presents thousands of code examples (accompanied with source code) which can be copied/downloaded independantly. By using the online editor provided,readers can edit the examples and execute the code experimentally.


Color Picker
  The color picker is used to select the color from the color panel and can adjust the color darkness.

Requirement:-
  You need to download integrate the following js files and one css file.

colopick:
 colpick.js => this file is created for color picker functionality and actions.
 colpick.css => This file is used to give the style for the color picker.


If you want to display the color picker panel when you click on a text box your code should be like below.



jquery Color Picker
CSS Code-

#txtbxid {
margin:0;
padding:0;
border:0;
width:70px;
height:20px;
border-right:20px solid green;
line-height:20px;
}


jQuery Code-
$(window).load(function(){
$('#txtbxid').colpick({
layout:'hex',
submit:0,
colorScheme:'dark',
onChange:function(hsb,hex,rgb,el,bySetColor) {
$(el).css('border-color','#'+hex);
// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
if(!bySetColor) $(el).val(hex);
}
}).keyup(function(){
$(this).colpickSetColor(this.value);
});
});

Your TextBox-
<input type="text" id="txtbxid"></input>



Download Full Source Code

0 comments:

Post a Comment

Total Pageviews