Thread: Please advise

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    1
    Rep Power
    0

    Please advise


    Hello I am currently learning new things web wise one of them being java , I have been working with fabric.js and I have a free draw mode and want to enable color change when click button I have attached my html and script please can you help me and explain what I am doing wrong if possible.

    html:

    <button id="freedraw" class="btn btn-info">Enter drawing mode</button>
    <br>

    <p>Stroke Color:</p> <input id="freedraw" class="color{pickerClosable:true,hash:true}"
    onchange="freedrawcolor('#'+this.color)" value="000000" style="width:60px;">




    js:

    $(function(){

    canvas.freeDrawingLineWidth = 15;



    document.getElementById('freedraw').addEventListener('click', function () {
    canvas.isDrawingMode = !canvas.isDrawingMode;

    function freedrawcolor(a)
    {var b=canvas.getActiveObject();b&&"freedraw"===b.type&&(this.color=a,canvas.renderAll())}
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    The Pleiades
    Posts
    299
    Rep Power
    9
    Have you tried using console.log() on some variables to see what values they hold?

    Your second line of jQuery looks wrong to me, unless you have saved canvas somewhere before.

    Kind regards,

    NM.

IMN logo majestic logo threadwatch logo seochat tools logo