本文介绍了织物对象的不透明度滑块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个画布,它包含织物对象.我想为画布中文本区域的背景"textbackroundColor"做一个不透明度滑块.我该如何滑动和更改功能?
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
});
推荐答案
另一种方式,通过结合$(document).on的范围输入.
Another way, via a range input coupled with $(document).on
$(document).on("change", "#alpha", function () {
transval = $(this).val();
var obj = canvas.getActiveObject();
obj.set({
opacity: transval
});
canvas.renderAll();
});
这篇关于织物对象的不透明度滑块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!