M
M
maksimkoh2016-12-22 00:54:10
JavaScript
maksimkoh, 2016-12-22 00:54:10

How to set transparent background with data-background-color?

Good evening! There was a problem. I do animation in Spine and export to json.
I insert the whole thing on the page and I can’t make the background of the animation transparent, although I can change the color.
Through css it does not make it possible to do this, c js is not very at odds.
Demo:
maksimkokhtenko.com/demo/flint
Html:

<div class="spine-widget" data-json="skeleton.json" data-atlas="skeleton.atlas" data-scale="0.5"   data-animation="animation" style="height: 300px; width: 300px; "></div>

css
body {
  background-image: url(bg.jpg);
  background-repeat: no-repeat;
  overflow-x: hidden; 
  background-size: 600px;
}

.spine-widget {
  padding-top: 230px;
}

js:
maksimkokhtenko.com/demo/flint/spine-widget.js

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepanya, 2016-12-22
@maksimkoh

Do it like this

<div class="spine-widget" data-background-color="#00000000" data-json="skeleton.json" data-atlas="skeleton.atlas" data-scale="0.5"   data-animation="animation" style="height: 300px; width: 300px; "></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question