...

View Full Version : clipboard



timgolding
12-08-2006, 04:40 PM
I have made a colour chart web page for some students to use to see:

Web safe 219 colours
X11 named colours
VGA 16 named colours
Web Smart (4096 colours)


Each colour is represented by a div which has appropriate bg colour. I have titled each div with the name and HEX value of the colour. This is so when I hold the mouse over a div is tells us the colour values of the div. That great but It would be highly benificial if the students could click the div and the hex value/named value could be written to the clip board.

Is there a script for sending text to the clipboard?

rubenbuhr
12-08-2006, 06:49 PM
There is a very nifty IE only script if you care for it? Most folks are always looking for something Xbrowser.
Give an example of one of your DIV color tags and I'll whip it up for you.

timgolding
12-12-2006, 11:33 AM
<div class="cols" style="background-color:#000033;" title="Hex: #000033" onclick="update('000,000,255','0000FF','blue');">&nbsp;</div>

It is the middle parameter in the call to update function. The Hex value

Thanks

rubenbuhr
12-12-2006, 05:49 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>put something on the clipboard </TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE type=text/CSS>

</STYLE>
<SCRIPT type="text/javascript">
function update(a,b,c){
document.getElementById('CB').value=a;
Copied = document.getElementById('CB').createTextRange();
Copied.execCommand("Copy");
}
</SCRIPT>

<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<input type=hidden ID="CB">
<div class="cols" style="background-color:#000033;" title="Hex: #000033" onclick="update('000,000,255','0000FF','blue');">&nbsp;</div>

<TEXTAREA>test it here</TEXTAREA>

</BODY></HTML>

timgolding
12-15-2006, 04:01 PM
thx :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum