Hi,
I am new to use the php,javascript.
I have done the coding for color palette.But now i also do something like by clicking the image the palette get open. But what my problem is i cann't able to select the color i want. Please tell me what i am doing wrong.Otherwise please suggest me some other code.My code is
I am new to use the php,javascript.
I have done the coding for color palette.But now i also do something like by clicking the image the palette get open. But what my problem is i cann't able to select the color i want. Please tell me what i am doing wrong.Otherwise please suggest me some other code.My code is
Code:
<html> <head> <script type="text/javascript"> function getColor1() { alert("hai"); var img = document.createElement("img"); img.src = "img/palette.gif"; //img.height = 75; //img.width = 113; //img.style.top=800; //img.style.right=100; document.body.appendChild(img); getColor(); } function getColor(block) {alert("hai1"); var s_url=block.href; var pColor=s_url.substr(s_url.indexOf("#")); document.getElementById("colorPalDemo").style.Color=pColor; //getColor1(); } </script> </head> <body> <img src="img/supst.png" usemap="#color_pallete" onClick="getColor1();" /> <map name="color_pallete" id="color_pallete"> <area shape="rect" coords="7,7,31,30" href="#FF0000" onclick="getColor(this);" /> <area shape="rect" coords="35,7,59,30" href="#00FF00" onclick="getColor(this);" /> <area shape="rect" coords="63,7,87,31" href="#0000FF" onclick="getColor(this);" /> <area shape="rect" coords="92,7,115,31" href="#8B008B" onclick="getColor(this);" /> <area shape="rect" coords="7,33,30,58" href="#00FFFF" onclick="getColor(this);"/> <area shape="rect" coords="36,34,59,57" href="#006400" onclick="getColor(this);" /> <area shape="rect" coords="63,34,86,58" href="#6B8E23" onclick="getColor(this);" /> <area shape="rect" coords="92,35,115,57" href="#00FF7F" onclick="getColor(this);" /> <area shape="rect" coords="8,61,31,85" href="#32CD32" onclick="getColor(this);" /> <area shape="rect" coords="35,62,59,85" href="#7FFFD4" onclick="getColor(this);" /> <area shape="rect" coords="64,61,86,85" href="#7FFF00" onclick="getColor(this);" /> <area shape="rect" coords="92,61,115,85" href="#008B8B" onclick="getColor(this);" /> <area shape="rect" coords="91,88,115,111" href="#9932CC" onclick="getColor(this);" /> <area shape="rect" coords="64,88,87,111" href="#00BFFF" onclick="getColor(this);" /> <area shape="rect" coords="36,88,59,112" href="#1E90FF" onclick="getColor(this);" /> <area shape="rect" coords="8,88,30,111" href="#FF4500" onclick="getColor(this);" /> </map> <span id="colorPalDemo"></span> </body> </html>
Comment