< html >
< body >
<!-- , ZeroClipboard.swf *.js -->
< script type ="text/javascript" src ="ZeroClipboard.js" ></ script >
<!-- -->
<div id= "d_clip_button" style= "border:1px solid black; padding:20px;" >Copy To Clipboard</div>
<script language= "JavaScript" >
//
var clip = new ZeroClipboard.Client();
//
clip.setText( 'Copy me!' );
//
clip.glue( 'd_clip_button' );
</ script >
</ body >
</ html >
* This source code was highlighted with Source Code Highlighter .
< html >
< head >
< style type ="text/css" >
#d_clip_button {
text-align:center;
border:1px solid black;
background-color:#ccc;
margin:10px; padding:10px;
}
/* -- */
#d_clip_button.hover { background-color:#eee; }
#d_clip_button.active { background-color:#aaa; }
</ style >
</ head >
< body >
< script type ="text/javascript" src ="ZeroClipboard.js" ></ script >
Copy to Clipboard: <input type= "text" id= "clip_text" size= "40" value= "Copy me!" /><br/><br/>
<div id= "d_clip_button" >Copy To Clipboard</div>
<script language= "JavaScript" >
var clip = new ZeroClipboard.Client();
clip.setMoviePath( 'ZeroClipboard.swf' ); //
clip.setText( '' ); // onouseDown
clip.setHandCursor( true ); //
clip.setCSSEffects( true ); // CSS
clip.addEventListener( 'load' , function (client) {
// alert( " " );
});
clip.addEventListener( 'complete' , function (client, text) {
alert( " : " + text );
});
clip.addEventListener( 'mouseOver' , function (client) {
// alert(" ");
});
clip.addEventListener( 'mouseOut' , function (client) {
// alert(" ");
});
clip.addEventListener( 'mouseDown' , function (client) {
// alert(" ");
// , 'clip_text'
clip.setText( document .getElementById( 'clip_text' ).value );
});
clip.addEventListener( 'mouseUp' , function (client) {
// alert(" ");
});
// 'd_clip_button'
clip.glue( 'd_clip_button' );
</ script >
</ body >
</ html >
* This source code was highlighted with Source Code Highlighter .
Typed on bald keyboard
Source: https://habr.com/ru/post/64767/
All Articles