最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Increase the height of JSignature input area - Stack Overflow

programmeradmin7浏览0评论

I am using JSignature to accept the signature. How can i increase the default height? I tried giving height to the signature div but not working as expected.

Code:
<div id="signature" style="background-color:#fff9cb;border:0px;height:200px"></div>

How to fix this?

I am using JSignature to accept the signature. How can i increase the default height? I tried giving height to the signature div but not working as expected.

Code:
<div id="signature" style="background-color:#fff9cb;border:0px;height:200px"></div>

How to fix this?

Share Improve this question asked May 21, 2014 at 6:44 user3554548user3554548 852 silver badges7 bronze badges 2
  • I am using github./willowsystems/jSignature to capture the signature. The Html code is mentioned above to add the Jsignature canvas element. It takes the height dynamically based on screen width and height. I would like to increase the height to 200px. – user3554548 Commented May 21, 2014 at 6:51
  • Any idea on how to fix this. – user3554548 Commented May 21, 2014 at 7:56
Add a ment  | 

3 Answers 3

Reset to default 3

replace this line in jSignature Sample

var $sigdiv = $("#signature").jSignature({ 'UndoButton': true })

to

var $sigdiv = $("#signature").jSignature({ 'UndoButton': true, 'width': 400, 'height': 400 })

I've had trouble altering the size or the line width of the signature box in <div> (capture) and <img> (display) tags. Try modifying the size with jQuery (and make sure you have jSignature.js added to your project):

<div id="mySignatureBox" style="background:#000000; color:#ffffff"></div>   

$('#mySignatureBox').jSignature({ lineWidth: 1, width: 700, height: 200 });

It seems you can also use percentage values, this did the job for me:

$('#signature').jSignature({
  width: '100%',
  height: 250
});
发布评论

评论列表(0)

  1. 暂无评论