Hello!
I'm trying to make some randomization with images and it would be super useful to access variables I set in Harlowe inside the Javascript, but I can't find out how to do that...
Here's an example of what I want:
So, the idea is to access $has_book from inside the Javascript, is that possible?
Thank you
I'm trying to make some randomization with images and it would be super useful to access variables I set in Harlowe inside the Javascript, but I can't find out how to do that...
Here's an example of what I want:
(set: $has_book to true) <div id="img_holder"> <img class='overimg' src='bg.png'> </div> <script type="text/javascript"> var images = ['left','right','left2','right2']; if ($('$has_book').value==101) { $('#img_holder').append("<img class='overimg' src='" + images[Math.floor(Math.random() * images.length)] + ".png'>"); } </script>
So, the idea is to access $has_book from inside the Javascript, is that possible?
Thank you