homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Text color
By clicking the image the palette is to get open
tweety




msg:4555977
 5:20 am on Mar 18, 2013 (gmt 0)

Hi,
I am new to php,javascript.Now i am doing the color palette. But i did the palette.But now i want to make the palette get open when clicking the image. Please help me how to do that.
The following is my 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.fontColor=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>

Please tell me what i am doing wrong here.

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved