您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->小范企业管理源码>>FTB_1.6.3_zh/HelperScripts/ftb.colorpicker.aspx>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:小范企业管理源码


当前文件路径:XiaoFanWeb/FTB_1.6.3_zh/HelperScripts/ftb.colorpicker.aspx 文件类型
普通视图
		            
1<%@ Page language="c#" %> 2<html> 3<head> 4<title>拾色器</title> 5<style> 6.cc { 7 width:10;height:8; 8} 9</style> 10<script launguage="JavaScript"> 11function colorOver(theTD) { 12 previewColor(theTD.style.backgroundColor); 13 setTextField(theTD.style.backgroundColor); 14} 15function colorClick(theTD) { 16 setTextField(theTD.style.backgroundColor); 17 returnColor(theTD.style.backgroundColor); 18} 19function setTextField(ColorString) { 20 document.getElementById("ColorText").value = ColorString.toUpperCase(); 21} 22function returnColor(ColorString) { 23 window.returnValue = ColorString; 24 window.close(); 25} 26function userInput(theinput) { 27 previewColor(theinput.value); 28} 29function previewColor(theColor) { 30 try { 31 PreviewDiv.style.backgroundColor = theColor; 32 } catch (e) { 33 } 34} 35</script> 36</head> 37 38<body style="background-color:d4d0c8; margin: 2 2 2 2;"> 39<form runat="server"> 40 41<table cellpadding=0 cellspacing=0 border=0> 42<tr><td colspan=3> 43 <asp:Literal id="Colors" 44 runat="server" EnableViewState="false" /> 45</td></tr> 46<tr> 47 <td><input type="text" name="ColorText" id="ColorText" style="width:60;height:22;" onkeyup="userInput(this);"></td> 48 <td align=center><div id="PreviewDiv" style="width:50;height:20;border: 1 solid black; background-color: #ffffff;">&nbsp;</div></td> 49 <td align=right><input type="button" value="确定" onclick="returnColor(ColorText.value);" id="ColorButton" style="width:80;"></td> 50</tr> 51</table> 52 53</form> 54</body> 55</html> 56<script language="c#" runat="server"> 57private void Page_Load(object sender, System.EventArgs e) { 58 int onrow=1; 59 int oncol=1; 60 int count=1; 61 string s =""; 62 string set1 = ""; 63 string set2 = ""; 64 for (int r=5; r>=0; r--) { 65 for (int g=5; g>=0; g--) { 66 for (int b=5; b>=0; b--) { 67 if (oncol==1) s += "<tr>\n"; 68 s += "\t<td onmouseover=\"colorOver(this);\" onclick=\"colorClick(this);\" style=\"background-color:"+ReturnHex(r)+ReturnHex(g)+ReturnHex(b)+";\" class=cc></td>\n"; 69 oncol++; 70 if (oncol >= 19) { 71 s+="</tr>\n"; 72 oncol = 1; 73 74 if (onrow % 2 == 0) { 75 set2 += s; 76 } else { 77 set1 += s; 78 } 79 s = ""; 80 onrow++; 81 } 82 count++; 83 } 84 } 85 } 86 Colors.Text = "<table cellpadding=0 cellspacing=1 style=\"background-color:ffffff;\" border=0 >" + set1 + set2 + "</table>"; 87} 88 89string ReturnHex(int i) { 90 switch (i) { 91 default: 92 case 0: 93 return "00"; 94 case 1: 95 return "33"; 96 case 2: 97 return "66"; 98 case 3: 99 return "99"; 100 case 4: 101 return "CC"; 102 case 5: 103 return "FF"; 104 } 105} 106</script> 107
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:小范企业管理源码

- 北京某驾校全站源码

- X3BLOG多用户博客 0.7.5.2源代码

- GridView实用示例源码附加导..

- 小E内容管理系统Web层源码文件

- 通过数据的添加删除学三层入..

- 图书馆管理系统Asp.net2.0源码

- Ajax入门的三个实用小例子

- 简单的查勘信息调度管理系统

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号