Twine Sugarcube - Inserting div

51 Views Asked by At

I want to insert a div after a passage:

The JS is in the Story JS and the CSS in the Story Stylesheet.

$("<div id='case_1_image'></div>").insertAfter($("#passage-cs1-p1"));

#passage-cs1-p1{
  background-image: url('images/case_1.jpg');
  background-repeat: no-repeat;
  background-size: cover;
}

#case_1_image {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  background-color: red;
  height: 100%;
}

The div #case_1_image is not showing and also not in the page source.

What am I doing wrong?

BTW the div #passage-cs1-p1shows the background image fine.

0

There are 0 best solutions below