Opacity slider for a fabric object
问题 I have a canvas and it includes fabric objects.I want to do opacity slider for text area's backround "textbackroundColor" in canvas.How can I do slide and change functions? $("#backgroundOpacity").slider( { min: 10, max: 50, value: 30, slide: text_bgColor_slider_moved, change: text_bgColor_slider_changed }); 回答1: first get active object of canvas var activeObject = canvas.getActiveObject(); and then $("#backgroundOpacity").slider( { max : 100, value : activeObject.opacity * 100, slide: