我正在我的演示中实现Signature插件。所以我从[this url] [1]下载了这个插件。
demo html包含一个类kbw-signature
,它不适用于代码中的任何元素。但是,当我以某种方式运行它时,它将应用于给定的div
。所以我搜索了文件,并没有将它应用于div
的行。
其次:如何在jsfiddle中使用jQuery签名插件?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>jQuery UI Signature Basics</title>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/south-street/jquery-ui.css" rel="stylesheet">
<link type="text/css" href="jquery.signature.css" rel="stylesheet">
<style type="text/css">
.kbw-signature { width: 400px; height: 200px; }
</style>
<!--[if IE]>
<script type="text/javascript" src="excanvas.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.signature.js"></script>
<script type="text/javascript">
$(function() {
$('#sig').signature();
$('#clear').click(function() {
$('#sig').signature('clear');
});
$('#json').click(function() {
alert($('#sig').signature('toJSON'));
});
});
</script>
</head>
<body>
<h1>jQuery UI Signature Basics</h1>
<p>This page demonstrates the very basics of the
<a href="http://keith-wood.name/signature.html">jQuery UI Signature plugin</a>.
It contains the minimum requirements for using the plugin and
can be used as the basis for your own experimentation.</p>
<p>For more detail see the <a href="http://keith-wood.name/signatureRef.html">documentation reference</a> page.</p>
<p>Default signature:</p>
<div id="sig"></div>
<p style="clear: both;"><button id="clear">Clear</button> <button id="json">To JSON</button></p>
</body>
</html>