Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Harlowe and Javascript

$
0
0
I´m trying to change the background image of a <div> by moving to another passage.
I want to use javaScript to do so, mostly because I´m using this as an exercise to learn html, css and javascript.

The code I got is the following:
document.getElementById('con_area_id').style.backgroundImage="LocArray[0].bg";
the div id and path is all correct but I get this error: "Cannot read property 'style' of null"

So I assume .style isnt the right way to get that image in twine, I cant find anything regarding that though.


Also I would like to have the script in an external file but from what I read on here that is not possible?
I saw some solutions with jquery, but I just want to use my own locally stored scripts.

Any ideas?



Thanks in advance!

Viewing all articles
Browse latest Browse all 1844

Trending Articles