javascript - unbind jquery to copt the output text -


i trying unbind on element - #result

the output box has id of #result

because have ("input, body")

the bind happen on body - keyup click , mousemove

i need when ever click #result box wil not bind or unbind

you can see example here http://5t5t5t5t5t5t5.weebly.com/

click generate widget show result box issue can not highlight text inside result box because event happening

// text output      $("input, body").bind("keyup click mousemove", function() {    $("#result").text(      '<div class="section-title-box animated fadeinup wow animated" data-wow-delay="0.2s">' +      '<h6 style="color:#' + $("#h6_color").val() +      ';">' + $("#h6_title_text").val() +      '</h6>' +      '<h2 style="color:#' + $("#h2_color").val() +      ';">' + $("#h2_title_text").val() +      '</h2>' +      '<hr style="border:2px solid #' + $("#hr_color").val() +      ';width:' + $("#hr_width").val() +      'px;">' +      '<p>' + $("#widg_content").val() + '</p>' +      '</div>'    );      $("#result").unbind('keyup click mousemove', '#result');    });

any appreciated - lee

this code did trick :)

function handleclick(event) {    $("#result").text(      '<div class="section-title-box animated fadeinup wow animated" data-wow-delay="0.2s">' +      '<h6 style="color:#' + $("#h6_color").val() +      ';">' + $("#h6_title_text").val() +      '</h6>' +      '<h2 style="color:#' + $("#h2_color").val() +      ';">' + $("#h2_title_text").val() +      '</h2>' +      '<hr style="border:2px solid #' + $("#hr_color").val() +      ';width:' + $("#hr_width").val() +      'px;">' +      '<p>' + $("#widg_content").val() + '</p>' +      '</div>'    );  }    $('input, body').on('keyup mousedown', handleclick);    $('input, body').off('click', '#result', handleclick);

thanks https://stackoverflow.com/users/4001497/sushil


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -