나는 jQuery Background Canvas 플러그인을 사용하고 둥근 모서리와 그라디언트 효과가있는 DIV를 만들었습니다. 그러나 투명성을 확보 할 수 없습니다. 내가 도대체 뭘 잘못하고있는 겁니까? 여기에 자바 스크립트는 다음과 같습니다jQuery 배경 캔버스 투명도
$(document).ready(function()
{
$(".Test").backgroundCanvas();
$(".Test").makeElementTransparent("#CECFCE");
$(".Test").backgroundCanvas(true, "#CECFCE");
});
function DrawBackground() {
$(".Test").backgroundCanvasPaint(TestBackgroundPaintFkt);
}
// Draw the background on load and resize
$(window).load(function() { DrawBackground(); });
$(window).resize(function() { DrawBackground(); });
function TestBackgroundPaintFkt(context, width, height, elementInfo)
{
var options = {x:0, height: height, width: width,
radius:7, border: 0 };
// Draw the red border rectangle
context.fillStyle = "#CECFC6";
$.canvasPaint.roundedRect(context,options);
// Draw the gradient filled inner rectangle
var backgroundGradient = context.createLinearGradient(0, 0,
0, height - 10);
backgroundGradient.addColorStop(0 ,'#F7F7EF');
backgroundGradient.addColorStop(1, '#CECFCE');
options.border = 1;
context.fillStyle = backgroundGradient;
$.canvasPaint.roundedRect(context,options);
}
자체는 다음과 같다 요소 : 여기
<div class="Test">
something here
</div>
을 그리고의 IT에 대한 CSS는 :
.Test {
width: 300px;
height: 300px;
}
이 라이브러리의 투명 기능을 HTML의 요소에 적용 할 수있는 알파 투명도로 잘못 생각한 것 같습니다. 사실, 이것은 내가 달성하고자하는 알파 투명성입니다. – Alex