willowsystems / jSignature

jQuery plugin - draw signature in browser.
720 stars 266 forks source link

Fixed width of 800px regardless of window size #69

Open databuzz opened 8 years ago

databuzz commented 8 years ago

I'm using the jSignature plugin to add signature capture to a simple Bootstrap form - the signature capture displays correctly and I can draw and save the signature without any issues.

My only issue at the moment is that the canvas appears to be fixed to a width of 800px, regardless of the size of the window. When I load the page in the browser (Safari 9.1.1) and adjust the size of the window the form fields resize accordingly, but the signature canvas stays fixed at 800px.

I'm not sure where the 800px is coming from (I had to hardcode a height of 200px to get it to display) - even if the parent div is smaller, e.g. 720px, the canvas still has a width of 800px.

Here's the form as it appears in my editor:

`


`

and here's the form as it appears in the browser:

`


`

and here's the Javascript:

$(document).ready(function() { $("#signature").jSignature({ height: 200 }); $('#btnSave').click(function() { var sigData = $('#signature').jSignature('getData', 'default'); $('#hiddenSigData').val(sigData); }); })