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

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
Post a Comment