javascript - How to use this selector in the jQuery -


i'm making drag , drop resizable template engine. i'm having problem think isn't hard fix, i'm stuck.

jquery code

$(".getinfo").click(function(){ $("b").mousemove(function(){         var bodycolor =  $("#bgcolor").css("backgroundcolor");  $(this).css("background-color",bodycolor); });  }); 

html code

<div  id="resizable1" class="drag resize getinfo"> <h3 class="ui-widget-header">slide show</h3> </div> 

demo image

enter image description here

i need have this.

when user clicks on div class name .getinfo , user clicks color in colorpicker want assign clicked div. try using above code had no luck.

don't bind mousemove colour picker inside click. need separate. try this:

var bodycolor = "#ffffff"; //declared globally, default color  $("b").mousemove(function(){     bodycolor =  $("#bgcolor").css("backgroundcolor"); });  $(".getinfo").click(function(){     $(this).css("background-color",bodycolor); }); 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -