html - Replace Text with Image by get user input in Javascript? -


i have modify program replace image text. in program, value of input box should reflect in place of balloon image. me ?

program link:

$('#draw').click(function() {     var text = document.getelementbyid('txtballon').value;          var $ballon = $('#ballon'),             $canvas = $('#canvas');         var ballon_x = $ballon.offset().left - $canvas.offset().left,             ballon_y = $ballon.offset().top - $canvas.offset().top;          context.drawimage(ballon, ballon_x, ballon_y);          $ballon.hide();         $(this).attr('disabled', 'disabled');     }); 

jsfiddle

you can following way:

context.font = "30px verdana"; context.filltext(text,ballon_x,ballon_y); 

instead of context.drawimage(ballon, ballon_x, ballon_y);

working fiddle

updated fiddle text drag


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -